diff options
author | Jeff Mahoney <jeffm@suse.de> | 2012-08-18 15:20:38 -0400 |
---|---|---|
committer | James Bottomley <JBottomley@Parallels.com> | 2012-09-14 17:59:28 +0100 |
commit | e3f2a9cc84d35fac73c906de57ad3b3f5ff82008 (patch) | |
tree | 1815e0bc169e06a3f057aec22683940537811058 /drivers/scsi/st.c | |
parent | af23782beff27e720318fc44495287b9961a88e1 (diff) | |
download | blackbird-op-linux-e3f2a9cc84d35fac73c906de57ad3b3f5ff82008.tar.gz blackbird-op-linux-e3f2a9cc84d35fac73c906de57ad3b3f5ff82008.zip |
[SCSI] st: clean up dev cleanup in st_probe
st_probe leaves a cdev pointer hanging around that is compared
during the error path and freed later. There's no need for the pointer
to hang around at all. So we free it immediately and simplify the error
handling.
Reviewed-by: Lee Duncan <lduncan@suse.com>
Signed-off-by: Jeff Mahoney <jeffm@suse.com>
Acked-by: Kai Mäkisara <kai.makisara@kolumbus.fi>
Signed-off-by: James Bottomley <JBottomley@Parallels.com>
Diffstat (limited to 'drivers/scsi/st.c')
-rw-r--r-- | drivers/scsi/st.c | 11 |
1 files changed, 4 insertions, 7 deletions
diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c index 03303ae44434..492b53b6e51d 100644 --- a/drivers/scsi/st.c +++ b/drivers/scsi/st.c @@ -4156,6 +4156,7 @@ static int st_probe(struct device *dev) printk(KERN_ERR "st%d: out of memory. Device not attached.\n", dev_num); + cdev_del(cdev); goto out_free_tape; } cdev->owner = THIS_MODULE; @@ -4194,17 +4195,13 @@ out_free_tape: "tape"); for (j=0; j < 2; j++) { if (STm->cdevs[j]) { - if (cdev == STm->cdevs[j]) - cdev = NULL; - device_destroy(&st_sysfs_class, - MKDEV(SCSI_TAPE_MAJOR, - TAPE_MINOR(i, mode, j))); + device_destroy(&st_sysfs_class, + MKDEV(SCSI_TAPE_MAJOR, + TAPE_MINOR(i, mode, j))); cdev_del(STm->cdevs[j]); } } } - if (cdev) - cdev_del(cdev); write_lock(&st_dev_arr_lock); scsi_tapes[dev_num] = NULL; st_nr_dev--; |