diff options
Diffstat (limited to 'drivers/scsi')
-rw-r--r-- | drivers/scsi/sg.c | 11 |
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c index ebbf9b4b7e90..78ac48df4de8 100644 --- a/drivers/scsi/sg.c +++ b/drivers/scsi/sg.c | |||
@@ -1434,11 +1434,14 @@ sg_add(struct class_device *cl_dev, struct class_interface *cl_intf) | |||
1434 | MKDEV(SCSI_GENERIC_MAJOR, sdp->index), | 1434 | MKDEV(SCSI_GENERIC_MAJOR, sdp->index), |
1435 | cl_dev->dev, "%s", | 1435 | cl_dev->dev, "%s", |
1436 | disk->disk_name); | 1436 | disk->disk_name); |
1437 | if (IS_ERR(sg_class_member)) | 1437 | if (IS_ERR(sg_class_member)) { |
1438 | printk(KERN_WARNING "sg_add: " | 1438 | printk(KERN_ERR "sg_add: " |
1439 | "class_device_create failed\n"); | 1439 | "class_device_create failed\n"); |
1440 | error = PTR_ERR(sg_class_member); | ||
1441 | goto cdev_add_err; | ||
1442 | } | ||
1440 | class_set_devdata(sg_class_member, sdp); | 1443 | class_set_devdata(sg_class_member, sdp); |
1441 | error = sysfs_create_link(&scsidp->sdev_gendev.kobj, | 1444 | error = sysfs_create_link(&scsidp->sdev_gendev.kobj, |
1442 | &sg_class_member->kobj, "generic"); | 1445 | &sg_class_member->kobj, "generic"); |
1443 | if (error) | 1446 | if (error) |
1444 | printk(KERN_ERR "sg_add: unable to make symlink " | 1447 | printk(KERN_ERR "sg_add: unable to make symlink " |