greybus: operation: suppress response submission on connection tear down

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>
This commit is contained in:
Johan Hovold 2015-07-14 15:43:29 +02:00 committed by Greg Kroah-Hartman
parent c600e535a7
commit 886c6069bc
1 changed files with 3 additions and 0 deletions

View 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))