greybus: loopback: Retrun -ENOMEM if operation allocation fails
authorBryan O'Donoghue <bryan.odonoghue@linaro.org>
Fri, 11 Dec 2015 13:46:51 +0000 (13:46 +0000)
committerGreg Kroah-Hartman <gregkh@google.com>
Sat, 12 Dec 2015 00:16:01 +0000 (16:16 -0800)
commitc7aae4e613ef471f9f785e4b85de4d46d552c86b
tree96d44aa7a724e51b736ae7eaf26c24cb5dbc5771
parent578a0ab8dd02f1de4b3b0e7b227ff78ae54fa4e1
greybus: loopback: Retrun -ENOMEM if operation allocation fails

If operation allocation fails we should return -ENOMEM in the asynchronous
operation send routine. If we don't return here then the
gb_loopback_async_operation_put() later can dereference a NULL pointer if
the previous gb_operation_create() failed.

Reported-by: Johan Hovold <johan@hovoldconsulting.com>
Signed-off-by: Bryan O'Donoghue <bryan.odonoghue@linaro.org>
Reviewed-by: Johan Hovold <johan@hovoldconsulting.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/loopback.c