Commit c2f79238 authored by Alexandre Bailon's avatar Alexandre Bailon Committed by Greg Kroah-Hartman

greybus: protocol.c: fix a kernel panic caused by __gb_protocol_register

__gb_protocol_register check if the protocol is not already registred,
and then register it. It register in existing->lists but at this point,
existing is always NULL (we exist just before if not).
Use gb_protocols instead.
Signed-off-by: default avatarAlexandre Bailon <abailon@baylibre.com>
Signed-off-by: default avatarGreg Kroah-Hartman <greg@kroah.com>
parent 89210f64
......@@ -70,7 +70,7 @@ int __gb_protocol_register(struct gb_protocol *protocol, struct module *module)
* We need to insert the protocol here, before the existing one
* (or before the head if we searched the whole list)
*/
list_add_tail(&protocol->links, &existing->links);
list_add_tail(&protocol->links, &gb_protocols);
spin_unlock_irq(&gb_protocols_lock);
pr_info("Registered %s protocol.\n", protocol->name);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment