If a protocol was not successfully created, we can't drop the refcount
on it. This might happen for example if the connection fails to bind a
protocol.
Silences a warning on cleanup.
Signed-off-by: Perry Hung <perry@leaflabs.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@google.com>
list_del(&connection->hd_links);
spin_unlock_irq(&gb_connections_lock);
- gb_protocol_put(connection->protocol);
+ if (connection->protocol)
+ gb_protocol_put(connection->protocol);
connection->protocol = NULL;
id_map = &connection->hd->cport_id_map;
u8 minor;
u8 protocol_count;
- if (WARN_ON(!protocol))
- return;
-
id = protocol->id;
major = protocol->major;
minor = protocol->minor;