Commit a14af325 authored by Sebastian Ott's avatar Sebastian Ott Committed by Greg Kroah-Hartman

driver core: don't trigger uevent after failure

Do not send the uevent if driver_add_groups failed.
Reported-by: default avatarMing Lei <ming.lei@canonical.com>
Signed-off-by: default avatarSebastian Ott <sebott@linux.vnet.ibm.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent db1b9037
...@@ -185,9 +185,10 @@ int driver_register(struct device_driver *drv) ...@@ -185,9 +185,10 @@ int driver_register(struct device_driver *drv)
if (ret) if (ret)
return ret; return ret;
ret = driver_add_groups(drv, drv->groups); ret = driver_add_groups(drv, drv->groups);
if (ret) if (ret) {
bus_remove_driver(drv); bus_remove_driver(drv);
return ret;
}
kobject_uevent(&drv->p->kobj, KOBJ_ADD); kobject_uevent(&drv->p->kobj, KOBJ_ADD);
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment