From: Cornelia Huck Date: Fri, 22 Sep 2006 09:37:00 +0000 (+0200) Subject: driver core fixes: sysfs_create_link() retval check in class.c X-Git-Tag: v2.6.19-rc3~126^2~9 X-Git-Url: https://err.no/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=f0e1761ac528e9d28f3ba06bd268ec41fe872ac8;p=linux-2.6 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 Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/base/class.c b/drivers/base/class.c index b32b77ff2d..0ff267a248 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;