mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-30 22:26:55 +00:00
greybus: connection: try cancelling operations only if list isn't empty
Signed-off-by: Viresh Kumar <viresh.kumar@linaro.org> Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
This commit is contained in:
parent
f66832dae0
commit
38d61ddf95
1 changed files with 4 additions and 5 deletions
|
@ -226,11 +226,10 @@ void gb_connection_destroy(struct gb_connection *connection)
|
|||
return;
|
||||
|
||||
/* XXX Need to wait for any outstanding requests to complete */
|
||||
WARN_ON(!list_empty(&connection->operations));
|
||||
|
||||
list_for_each_entry_safe(operation, next, &connection->operations,
|
||||
links) {
|
||||
gb_operation_cancel(operation);
|
||||
if (WARN_ON(!list_empty(&connection->operations))) {
|
||||
list_for_each_entry_safe(operation, next,
|
||||
&connection->operations, links)
|
||||
gb_operation_cancel(operation);
|
||||
}
|
||||
spin_lock_irq(&gb_connections_lock);
|
||||
list_del(&connection->interface_links);
|
||||
|
|
Loading…
Reference in a new issue