staging: unisys: stop device registration before visorbus registration
authorBenjamin Romer <benjamin.romer@unisys.com>
Fri, 4 Sep 2015 16:01:32 +0000 (12:01 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 13 Sep 2015 16:43:41 +0000 (09:43 -0700)
commit6155a3cf11a6d4ed102ef5a30f655d4d2a38076b
tree86c904abaec2fb61d9135dcf797eea9332a64648
parent418627ddc6d1ed50a3dfd2c8f938741b0cbcc1ed
staging: unisys: stop device registration before visorbus registration

In cases where visorbus is compiled directly into the kernel, if
visorbus registration fails for any reason, it is still possible for
other drivers to call visorbus_register_visor_driver(), which could
cause an oops. Prevent this by saving the result of the call to
create_bus() in a static variable, and return an error code when the bus
hasn't been registered successfully.

Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/staging/unisys/visorbus/visorbus_main.c