Skip to content

Commit

Permalink
driver core: don't trigger uevent after failure
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Sebastian Ott authored and Greg Kroah-Hartman committed Jul 17, 2012
1 parent db1b903 commit a14af32
Showing 1 changed file with 3 additions and 2 deletions.
5 changes: 3 additions & 2 deletions drivers/base/driver.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;
Expand Down

0 comments on commit a14af32

Please sign in to comment.