Commit d07e0361 authored by FUJITA Tomonori's avatar FUJITA Tomonori Committed by James Bottomley
Browse files

[SCSI] sg: handle class_device_create failure properly

Signed-off-by: default avatarFUJITA Tomonori <>
Acked-by: default avatarDouglas Gilbert <>
Signed-off-by: default avatarJames Bottomley <>
parent a24484f2
......@@ -1434,9 +1434,12 @@ sg_add(struct class_device *cl_dev, struct class_interface *cl_intf)
cl_dev->dev, "%s",
if (IS_ERR(sg_class_member))
printk(KERN_WARNING "sg_add: "
if (IS_ERR(sg_class_member)) {
printk(KERN_ERR "sg_add: "
"class_device_create failed\n");
error = PTR_ERR(sg_class_member);
goto cdev_add_err;
class_set_devdata(sg_class_member, sdp);
error = sysfs_create_link(&scsidp->sdev_gendev.kobj,
&sg_class_member->kobj, "generic");
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment