mirror of
https://github.com/torvalds/linux.git
synced 2024-12-29 22:31:32 +00:00
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:
parent
f6b6a8ec9a
commit
418627ddc6
@ -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);
|
||||||
|
Loading…
Reference in New Issue
Block a user