summaryrefslogtreecommitdiffstats
path: root/drivers/base
diff options
context:
space:
mode:
authorCornelia Huck <cornelia.huck@de.ibm.com>2006-09-22 11:37:00 +0200
committerGreg Kroah-Hartman <gregkh@suse.de>2006-10-18 12:49:54 -0700
commitf0e1761ac528e9d28f3ba06bd268ec41fe872ac8 (patch)
treef640fca2e9c9fdc6de76c6b997e45bb247fe0e40 /drivers/base
parent97a501849d60f3dbb8bfcd2300cf65dd5ebc0355 (diff)
downloadlinux-f0e1761ac528e9d28f3ba06bd268ec41fe872ac8.tar.bz2
driver core fixes: sysfs_create_link() retval check in class.c
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>
Diffstat (limited to 'drivers/base')
-rw-r--r--drivers/base/class.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/drivers/base/class.c b/drivers/base/class.c
index b32b77ff2dcd..0ff267a248db 100644
--- a/drivers/base/class.c
+++ b/drivers/base/class.c
@@ -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;