Skip to contentSkip to conversation

drivers/base: do not send KOBJ_ADD uevent if kobject_init_and_add fails

PATCH New Xiaotian Feng 1 participant 1 message Jul 24, 2009 Driver core

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 drivers/base: 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.

---
 drivers/base/sys.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
drivers/base/sys.c +1 -1
index 79a9ae5..0d90390 100644
@@ -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;
 }
 
Signature · 1 line
1.6.2.5