greybus: operation: suppress response submission on connection tear down
authorJohan Hovold <johan@hovoldconsulting.com>
Tue, 14 Jul 2015 13:43:29 +0000 (15:43 +0200)
committerGreg Kroah-Hartman <gregkh@google.com>
Wed, 15 Jul 2015 19:39:13 +0000 (12:39 -0700)
Suppress response submission on connection tear down as we do with
requests.

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

index 0adb727..2729b48 100644 (file)
@@ -705,6 +705,9 @@ static int gb_operation_response_send(struct gb_operation *operation,
        struct gb_connection *connection = operation->connection;
        int ret;
 
+       if (connection->state != GB_CONNECTION_STATE_ENABLED)
+               return -ENOTCONN;
+
        if (!operation->response &&
                        !gb_operation_is_unidirectional(operation)) {
                if (!gb_operation_response_alloc(operation, 0))