提交 79f0313b 编写于 作者: X Xiaotian Feng 提交者: Greg Kroah-Hartman

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: NXiaotian Feng <dfeng@redhat.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@suse.de>
上级 4df7b3e0
...@@ -275,9 +275,9 @@ int sysdev_register(struct sys_device *sysdev) ...@@ -275,9 +275,9 @@ int sysdev_register(struct sys_device *sysdev)
drv->add(sysdev); drv->add(sysdev);
} }
mutex_unlock(&sysdev_drivers_lock); mutex_unlock(&sysdev_drivers_lock);
kobject_uevent(&sysdev->kobj, KOBJ_ADD);
} }
kobject_uevent(&sysdev->kobj, KOBJ_ADD);
return error; return error;
} }
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册