Commit 38d61ddf authored by Viresh Kumar's avatar Viresh Kumar Committed by Greg Kroah-Hartman

greybus: connection: try cancelling operations only if list isn't empty

Signed-off-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
parent f66832da
...@@ -226,11 +226,10 @@ void gb_connection_destroy(struct gb_connection *connection) ...@@ -226,11 +226,10 @@ void gb_connection_destroy(struct gb_connection *connection)
return; return;
/* XXX Need to wait for any outstanding requests to complete */ /* XXX Need to wait for any outstanding requests to complete */
WARN_ON(!list_empty(&connection->operations)); if (WARN_ON(!list_empty(&connection->operations))) {
list_for_each_entry_safe(operation, next,
list_for_each_entry_safe(operation, next, &connection->operations, &connection->operations, links)
links) { gb_operation_cancel(operation);
gb_operation_cancel(operation);
} }
spin_lock_irq(&gb_connections_lock); spin_lock_irq(&gb_connections_lock);
list_del(&connection->interface_links); list_del(&connection->interface_links);
......
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