mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-14 01:49:20 -04:00
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>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
578a0ab8dd
commit
c7aae4e613
@@ -580,8 +580,8 @@ static int gb_loopback_async_operation(struct gb_loopback *gb, int type,
|
||||
operation = gb_operation_create(gb->connection, type, request_size,
|
||||
response_size, GFP_KERNEL);
|
||||
if (!operation) {
|
||||
ret = -ENOMEM;
|
||||
goto error;
|
||||
kfree(op_async);
|
||||
return -ENOMEM;
|
||||
}
|
||||
|
||||
if (request_size)
|
||||
|
||||
Reference in New Issue
Block a user