driver core: don't trigger uevent after failure

Do not send the uevent if driver_add_groups failed.

Reported-by: Ming Lei <[email protected]>
Signed-off-by: Sebastian Ott <[email protected]>
Signed-off-by: Greg Kroah-Hartman <[email protected]>
This commit is contained in:
Sebastian Ott 2012-07-17 10:39:10 +02:00 • committed by Greg Kroah-Hartman
commit a14af32564

View file

@ -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;