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>
static void legacy_connection_exit(struct gb_connection *connection)
{
- if (connection->state == GB_CONNECTION_STATE_DISABLED)
+ if (!connection->protocol)
return;
gb_connection_disable(connection);