Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit f0e1761a authored by Cornelia Huck's avatar Cornelia Huck Committed by Greg Kroah-Hartman
Browse files

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: default avatarCornelia Huck <cornelia.huck@de.ibm.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@suse.de>
parent 97a50184
Loading
Loading
Loading
Loading
+4 −1
Original line number Diff line number Diff line
@@ -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;