aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/scsi/sg.c
diff options
context:
space:
mode:
authorJames Bottomley <jejb@mulgrave.il.steeleye.com>2006-07-03 10:41:12 -0400
committerJames Bottomley <jejb@mulgrave.il.steeleye.com>2006-07-03 10:41:12 -0400
commitc4e00fac42f268ed0a547cdd1d12bb8399864040 (patch)
tree1a54d87be2066c49b71a03764fcb4fc7f9c68c41 /drivers/scsi/sg.c
parent29454dde27d8e340bb1987bad9aa504af7081eba (diff)
parentd6b0c53723753fc0cfda63f56735b225c43e1e9a (diff)
Merge ../scsi-misc-2.6
Conflicts: drivers/scsi/nsp32.c drivers/scsi/pcmcia/nsp_cs.c Removal of randomness flag conflicts with SA_ -> IRQF_ global replacement. Signed-off-by: James Bottomley <James.Bottomley@SteelEye.com>
Diffstat (limited to 'drivers/scsi/sg.c')
-rw-r--r--drivers/scsi/sg.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/drivers/scsi/sg.c b/drivers/scsi/sg.c
index 4e607d3065bc..65eef33846bb 100644
--- a/drivers/scsi/sg.c
+++ b/drivers/scsi/sg.c
@@ -1401,6 +1401,7 @@ sg_add(struct class_device *cl_dev, struct class_interface *cl_intf)
1401 Sg_device *sdp = NULL; 1401 Sg_device *sdp = NULL;
1402 struct cdev * cdev = NULL; 1402 struct cdev * cdev = NULL;
1403 int error, k; 1403 int error, k;
1404 unsigned long iflags;
1404 1405
1405 disk = alloc_disk(1); 1406 disk = alloc_disk(1);
1406 if (!disk) { 1407 if (!disk) {
@@ -1428,7 +1429,7 @@ sg_add(struct class_device *cl_dev, struct class_interface *cl_intf)
1428 1429
1429 error = cdev_add(cdev, MKDEV(SCSI_GENERIC_MAJOR, k), 1); 1430 error = cdev_add(cdev, MKDEV(SCSI_GENERIC_MAJOR, k), 1);
1430 if (error) 1431 if (error)
1431 goto out; 1432 goto cdev_add_err;
1432 1433
1433 sdp->cdev = cdev; 1434 sdp->cdev = cdev;
1434 if (sg_sysfs_valid) { 1435 if (sg_sysfs_valid) {
@@ -1455,6 +1456,13 @@ sg_add(struct class_device *cl_dev, struct class_interface *cl_intf)
1455 1456
1456 return 0; 1457 return 0;
1457 1458
1459cdev_add_err:
1460 write_lock_irqsave(&sg_dev_arr_lock, iflags);
1461 kfree(sg_dev_arr[k]);
1462 sg_dev_arr[k] = NULL;
1463 sg_nr_dev--;
1464 write_unlock_irqrestore(&sg_dev_arr_lock, iflags);
1465
1458out: 1466out:
1459 put_disk(disk); 1467 put_disk(disk);
1460 if (cdev) 1468 if (cdev)