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:
Xiaotian Feng 2009-07-24 17:31:41 +08:00 committed by Greg Kroah-Hartman
parent 4df7b3e037
commit 79f0313bfc
1 changed files with 1 additions and 1 deletions

View File

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