mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-26 21:54:11 +08:00
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: Alex Elder <elder@linaro.org> Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org> Reviewed-by: Johan Hovold <johan@hovoldconsulting.com> Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
parent
ac00154a7c
commit
814ae531d1
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user