summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--drivers/base/driver.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/base/driver.c b/drivers/base/driver.c
index 1b500d6fcc2e..974e301a1ef0 100644
--- a/drivers/base/driver.c
+++ b/drivers/base/driver.c
@@ -185,9 +185,10 @@ int driver_register(struct device_driver *drv)
if (ret)
return ret;
ret = driver_add_groups(drv, drv->groups);
- if (ret)
+ if (ret) {
bus_remove_driver(drv);
-
+ return ret;
+ }
kobject_uevent(&drv->p->kobj, KOBJ_ADD);
return ret;