driver core: sysdev: do not send KOBJ_ADD uevent if kobject_init_and_add fails
If kobject_init_and_add fails, sysdev_register should not send KOBJ_ADD uevent to userspace. Signed-off-by: Xiaotian Feng <dfeng@redhat.com> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
This commit is contained in:
parent
4df7b3e037
commit
79f0313bfc
|
@ -275,9 +275,9 @@ int sysdev_register(struct sys_device *sysdev)
|
|||
drv->add(sysdev);
|
||||
}
|
||||
mutex_unlock(&sysdev_drivers_lock);
|
||||
kobject_uevent(&sysdev->kobj, KOBJ_ADD);
|
||||
}
|
||||
|
||||
kobject_uevent(&sysdev->kobj, KOBJ_ADD);
|
||||
return error;
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue