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>
This commit is contained in:
parent
db1b903742
commit
a14af32564
1 changed files with 3 additions and 2 deletions
|
@ -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;
|
||||||
|
|
Loading…
Reference in a new issue