diff options
author | Sebastian Ott <sebott@linux.vnet.ibm.com> | 2012-07-17 08:39:10 (GMT) |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2012-07-17 17:40:23 (GMT) |
commit | a14af325641794d1ce8e676e9c4967342349195c (patch) | |
tree | 5f59e8d8b1d224651895e2fdad3172b15415bdd2 | |
parent | db1b9037424b8219449a6754e9b7e97b0523c426 (diff) | |
download | linux-a14af325641794d1ce8e676e9c4967342349195c.tar.xz |
driver core: don't trigger uevent after failure
Do not send the uevent if driver_add_groups failed.
Reported-by: Ming Lei <ming.lei@canonical.com>
Signed-off-by: Sebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
-rw-r--r-- | drivers/base/driver.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/drivers/base/driver.c b/drivers/base/driver.c index 1b500d6..974e301 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; |