From 01547770e6fc283ce74944415fc069d287de082a Mon Sep 17 00:00:00 2001 From: Johan Hovold Date: Tue, 19 Jan 2016 12:51:17 +0100 Subject: [PATCH] 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 Signed-off-by: Johan Hovold Signed-off-by: Greg Kroah-Hartman --- drivers/staging/greybus/legacy.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/staging/greybus/legacy.c b/drivers/staging/greybus/legacy.c index fd847f4..a2c0b9b 100644 --- a/drivers/staging/greybus/legacy.c +++ b/drivers/staging/greybus/legacy.c @@ -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); -- 2.7.4