staging: unisys: visornic: handle error return from device registration
authorBenjamin Romer <benjamin.romer@unisys.com>
Fri, 4 Sep 2015 16:01:33 +0000 (12:01 -0400)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sun, 13 Sep 2015 16:43:41 +0000 (09:43 -0700)
There is no code to handle an error return in visornic, when it tries to
register with visorbus. This patch handles an error return from
visorbus_register_visor_driver() by dropping out of initialization.

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

index 7b08a89..9d3c1e2 100644 (file)
@@ -2131,8 +2131,9 @@ static int visornic_init(void)
        if (!dev_num_pool)
                goto cleanup_workqueue;
 
-       visorbus_register_visor_driver(&visornic_driver);
-       return 0;
+       err = visorbus_register_visor_driver(&visornic_driver);
+       if (!err)
+               return 0;
 
 cleanup_workqueue:
        if (visornic_timeout_reset_workqueue) {