greybus: operation: complete operations on cancellation
authorJohan Hovold <johan@hovoldconsulting.com>
Tue, 14 Jul 2015 13:43:27 +0000 (15:43 +0200)
committerGreg Kroah-Hartman <gregkh@google.com>
Wed, 15 Jul 2015 19:39:13 +0000 (12:39 -0700)
Make sure to call the operation completion callback also when the
operation is being cancelled.

The completion callback may need to release resources allocated at
submission and the driver should be informed that the operation has
failed due to cancellation.

Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
drivers/staging/greybus/operation.c

index 5e8ea0289053d7210512c728275ef4820e527cc6..1e181d59c9b7f1024a2eb660c80da52503fb0428 100644 (file)
@@ -901,8 +901,7 @@ void gb_operation_cancel(struct gb_operation *operation, int errno)
        } else {
                if (gb_operation_result_set(operation, errno)) {
                        gb_message_cancel(operation->request);
-                       gb_operation_put_active(operation);
-                       gb_operation_put(operation);
+                       queue_work(gb_operation_workqueue, &operation->work);
                }
        }