greybus: protocol.c: fix a kernel panic caused by __gb_protocol_register
authorAlexandre Bailon <abailon@baylibre.com>
Thu, 22 Jan 2015 07:23:37 +0000 (15:23 +0800)
committerGreg Kroah-Hartman <greg@kroah.com>
Thu, 22 Jan 2015 13:15:23 +0000 (21:15 +0800)
commitc2f792382bc23bddd67a5da72faf9d46bf0f3ef9
tree3383f09380a4185246d70e1ada2609b54ab34b81
parent89210f64bae6bd6bba90d9e08d1b88b4ba103f59
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: Alexandre Bailon <abailon@baylibre.com>
Signed-off-by: Greg Kroah-Hartman <greg@kroah.com>
drivers/staging/greybus/protocol.c