Commit 814ae531 authored by Alex Elder's avatar Alex Elder Committed by Greg Kroah-Hartman

greybus: connection: verify disabled when destroyed

A connection must be in DISABLED state before it gets destroyed.
Warn if this is ever not the case (and do the disconnect) before
proceeding with connection destruction.
Signed-off-by: default avatarAlex Elder <elder@linaro.org>
Reviewed-by: default avatarViresh Kumar <viresh.kumar@linaro.org>
Reviewed-by: default avatarJohan Hovold <johan@hovoldconsulting.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@google.com>
parent ac00154a
......@@ -660,6 +660,9 @@ void gb_connection_destroy(struct gb_connection *connection)
if (!connection)
return;
if (WARN_ON(connection->state != GB_CONNECTION_STATE_DISABLED))
gb_connection_disable(connection);
mutex_lock(&gb_connection_mutex);
spin_lock_irq(&gb_connections_lock);
......
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