greybus: clean up gb_connection_operation_recv()
authorAlex Elder <elder@linaro.org>
Mon, 17 Nov 2014 14:08:39 +0000 (08:08 -0600)
committerGreg Kroah-Hartman <greg@kroah.com>
Mon, 17 Nov 2014 18:41:19 +0000 (10:41 -0800)
commit78496db0128bd50281e1318602f64ed9509d4b6a
tree6c689cf951c088498f2efa3bf782a0b5cc03ad90
parentb37716f67298191aabd9f0ef5ccdf2edd3d1a50c
greybus: clean up gb_connection_operation_recv()

This patch does some cleanup of gb_connection_operation_recv().
    - Improve the header comments
    - Verify message is big enough for header before interpreting
      beginning of the message as a header
    - Verify at buffer creation time rather than receive time that
      no operation buffer is bigger than the maximum allowed.  We
      can then compare the incoming data size against the buffer.
    - When a response message arrives, record its status in the
      operation result, not in the buffer status.
    - Record a buffer overflow as an operation error.

Signed-off-by: Alex Elder <elder@linaro.org>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
drivers/staging/greybus/operation.c
drivers/staging/greybus/operation.h