]> git.proxmox.com Git - mirror_ubuntu-zesty-kernel.git/commit
greybus: use null pointer for empty payload
authorAlex Elder <elder@linaro.org>
Wed, 3 Dec 2014 18:27:45 +0000 (12:27 -0600)
committerGreg Kroah-Hartman <greg@kroah.com>
Wed, 3 Dec 2014 23:08:17 +0000 (15:08 -0800)
commit746e0ef95ade8dd6d8633679a87ab573b5e1f69e
tree3197d035f8ba42437301f66dfb4d677cc2e1b901
parent7cfa699556731c0c7d93793c419eb83f37107de2
greybus: use null pointer for empty payload

Currently message->payload always points to the address immediately
following the header in a message.  If the payload length is 0, this
is not a valid pointer.

Change the code to assign a null pointer to the payload in this
case.  I have verified that no code dereferences the payload pointer
unless the payload is known to have non-zero size.

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