staging: unisys: visornic: handle error return from device registration

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>
This commit is contained in:
Benjamin Romer 2015-09-04 12:01:33 -04:00 committed by Greg Kroah-Hartman
parent 6155a3cf11
commit 8b5081c876
1 changed files with 3 additions and 2 deletions

View File

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