Commit 73f9d73f authored by Johan Hovold's avatar Johan Hovold Committed by Greg Kroah-Hartman

greybus: operation: fix cancellation use-after-free

The final reference of an operation will be put after its completion
handler has run, so we must not drop the reference if it has already
been scheduled to avoid use-after-free.
Signed-off-by: default avatarJohan Hovold <johan@hovoldconsulting.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
parent abb722e7
...@@ -846,8 +846,8 @@ void gb_operation_cancel(struct gb_operation *operation, int errno) ...@@ -846,8 +846,8 @@ void gb_operation_cancel(struct gb_operation *operation, int errno)
gb_message_cancel(operation->request); gb_message_cancel(operation->request);
if (operation->response) if (operation->response)
gb_message_cancel(operation->response); gb_message_cancel(operation->response);
gb_operation_put(operation);
} }
gb_operation_put(operation);
} }
EXPORT_SYMBOL_GPL(gb_operation_cancel); EXPORT_SYMBOL_GPL(gb_operation_cancel);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment