mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
synced 2026-05-05 20:33:49 -04:00
greybus: operation: fix null-deref on operation cancel
Incoming operations are created without a response message. If an operation were to be cancelled before it has been fully processed (e.g. on connection destroy), we would get a null-pointer dereference in gb_operation_cancel. Signed-off-by: Johan Hovold <johan@hovoldconsulting.com> Reviewed-by: Alex Elder <elder@linaro.org> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
This commit is contained in:
committed by
Greg Kroah-Hartman
parent
ff65be7a58
commit
772f3e9060
@@ -911,7 +911,8 @@ void gb_operation_cancel(struct gb_operation *operation, int errno)
|
||||
{
|
||||
if (gb_operation_result_set(operation, errno)) {
|
||||
gb_message_cancel(operation->request);
|
||||
gb_message_cancel(operation->response);
|
||||
if (operation->response)
|
||||
gb_message_cancel(operation->response);
|
||||
}
|
||||
gb_operation_put(operation);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user