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 коммит произвёл Greg Kroah-Hartman
Родитель f6b6a8ec9a
Коммит 418627ddc6
1 изменённых файлов: 2 добавлений и 0 удалений

Просмотреть файл

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