staging: unisys: visorbus: Unregister driver on error

If there is an error in registering driver attributes, unregister
the driver as well.

Signed-off-by: David Kershner <david.kershner@unisys.com>
Signed-off-by: Benjamin Romer <benjamin.romer@unisys.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
David Kershner 2015-09-04 12:01:31 -04:00 committed by Greg Kroah-Hartman
parent f6b6a8ec9a
commit 418627ddc6

View File

@ -885,6 +885,8 @@ int visorbus_register_visor_driver(struct visor_driver *drv)
if (rc < 0) if (rc < 0)
return rc; return rc;
rc = register_driver_attributes(drv); rc = register_driver_attributes(drv);
if (rc < 0)
driver_unregister(&drv->driver);
return rc; return rc;
} }
EXPORT_SYMBOL_GPL(visorbus_register_visor_driver); EXPORT_SYMBOL_GPL(visorbus_register_visor_driver);