mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-11-11 21:38:32 +08:00
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
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user