driver core fixes: sysfs_create_link() retval check in class.c
authorCornelia Huck <cornelia.huck@de.ibm.com>
Fri, 22 Sep 2006 09:37:00 +0000 (11:37 +0200)
committerGreg Kroah-Hartman <gregkh@suse.de>
Wed, 18 Oct 2006 19:49:54 +0000 (12:49 -0700)
Check for return value of sysfs_create_link() in class_device_add().

Signed-off-by: Cornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
drivers/base/class.c

index b32b77ff2dcd7c1814c66318a477b74840b88e2f..0ff267a248dba8ff5e215a380a54ea0f4221c7ce 100644 (file)
@@ -562,7 +562,10 @@ int class_device_add(struct class_device *class_dev)
                goto out2;
 
        /* add the needed attributes to this device */
-       sysfs_create_link(&class_dev->kobj, &parent_class->subsys.kset.kobj, "subsystem");
+       error = sysfs_create_link(&class_dev->kobj,
+                                 &parent_class->subsys.kset.kobj, "subsystem");
+       if (error)
+               goto out3;
        class_dev->uevent_attr.attr.name = "uevent";
        class_dev->uevent_attr.attr.mode = S_IWUSR;
        class_dev->uevent_attr.attr.owner = parent_class->owner;