Commit 188f9785 authored by Johan Hovold's avatar Johan Hovold Committed by Greg Kroah-Hartman

greybus: operation: fix cancellation of responses

An operation with a response in-flight will already have set the
operation result and would therefore never be cancelled by the current
implementation.

Note that the reference taken when sending the result will be dropped
in the message completion callback.

Also note that an incoming, non-unidirectional messages will always have
an allocated response if its result has been set.
Signed-off-by: default avatarJohan Hovold <johan@hovoldconsulting.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
parent fde7382b
......@@ -845,9 +845,10 @@ void gb_operation_cancel(struct gb_operation *operation, int errno)
{
if (gb_operation_result_set(operation, errno)) {
gb_message_cancel(operation->request);
if (operation->response)
gb_message_cancel(operation->response);
gb_operation_put(operation);
} else if (gb_operation_is_incoming(operation)) {
if (!gb_operation_is_unidirectional(operation))
gb_message_cancel(operation->response);
}
}
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