]> asedeno.scripts.mit.edu Git - linux.git/commit
greybus: operation: fix use-after-free when sending responses
authorJohan Hovold <johan@hovoldconsulting.com>
Fri, 27 Mar 2015 11:41:13 +0000 (12:41 +0100)
committerGreg Kroah-Hartman <greg@kroah.com>
Mon, 30 Mar 2015 13:10:06 +0000 (15:10 +0200)
commit0fb5acc4018c0da61f9084932d0cd816fab77eec
tree0c4561950289a390654b936143cb4b8385f157a4
parent37754030b0b9f7b81217b891cdc5f21dd7d29e4d
greybus: operation: fix use-after-free when sending responses

Fix use-after-free when sending responses due to reference imbalance.

Make sure to take a reference to the operation when sending responses.
This reference is dropped in greybus_data_sent when the message has been
sent, while the initial reference is dropped in gb_operation_work after
processing the corresponding request.

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