From: David Kershner Date: Fri, 4 Sep 2015 16:01:31 +0000 (-0400) Subject: staging: unisys: visorbus: Unregister driver on error X-Git-Url: https://git.karo-electronics.de/?a=commitdiff_plain;h=418627ddc6d1ed50a3dfd2c8f938741b0cbcc1ed;p=linux-beck.git 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 Signed-off-by: Benjamin Romer Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/staging/unisys/visorbus/visorbus_main.c b/drivers/staging/unisys/visorbus/visorbus_main.c index 2309f5f2b238..7905ea920a4a 100644 --- a/drivers/staging/unisys/visorbus/visorbus_main.c +++ b/drivers/staging/unisys/visorbus/visorbus_main.c @@ -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);