greybus: legacy: use protocol pointer to determine state

Use the protocol pointer to determine the legacy connection state.

This is needed to allow core disable connections when an interface has
been hot-unplugged without the legacy protocols leaking its resources.

Reviewed-by: Viresh Kumar <viresh.kumar@linaro.org>
Signed-off-by: Johan Hovold <johan@hovoldconsulting.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
This commit is contained in:
Johan Hovold
2016-01-19 12:51:17 +01:00
committed by Greg Kroah-Hartman
parent 50dfb87865
commit 01547770e6

View File

@@ -100,7 +100,7 @@ err_unbind_protocol:
static void legacy_connection_exit(struct gb_connection *connection)
{
if (connection->state == GB_CONNECTION_STATE_DISABLED)
if (!connection->protocol)
return;
gb_connection_disable(connection);