From: Xiaotian Feng Date: Fri, 24 Jul 2009 09:31:41 +0000 (+0800) Subject: driver core: sysdev: do not send KOBJ_ADD uevent if kobject_init_and_add fails X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=79f0313bfc67aa13abb931e8c12a1411f0161a68;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git 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 Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/base/sys.c b/drivers/base/sys.c index 79a9ae5238ac..0d903909af7e 100644 --- a/drivers/base/sys.c +++ b/drivers/base/sys.c @@ -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; }