summaryrefslogtreecommitdiffstats
path: root/drivers/scsi/st.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-04-14 18:21:35 -0700
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2013-04-14 18:21:35 -0700
commit2f093e2aa466d799c0952bfd1c6c68ff5d80fc17 (patch)
treee3d511aca536b7123d256b98a0ef8e74fc219498 /drivers/scsi/st.c
parenta7761027656dc192b59617a6eb961e38097419ce (diff)
parent41ef2d5678d83af030125550329b6ae8b74618fa (diff)
downloadlinux-2f093e2aa466d799c0952bfd1c6c68ff5d80fc17.tar.gz
linux-2f093e2aa466d799c0952bfd1c6c68ff5d80fc17.tar.bz2
linux-2f093e2aa466d799c0952bfd1c6c68ff5d80fc17.zip
Merge 3.9-rc7 into char-misc-next
We want the fixes in there. Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/scsi/st.c')
-rw-r--r--drivers/scsi/st.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/scsi/st.c b/drivers/scsi/st.c
index 86974471af68..2a32036a9404 100644
--- a/drivers/scsi/st.c
+++ b/drivers/scsi/st.c
@@ -4112,6 +4112,10 @@ static int st_probe(struct device *dev)
tpnt->disk = disk;
disk->private_data = &tpnt->driver;
disk->queue = SDp->request_queue;
+ /* SCSI tape doesn't register this gendisk via add_disk(). Manually
+ * take queue reference that release_disk() expects. */
+ if (!blk_get_queue(disk->queue))
+ goto out_put_disk;
tpnt->driver = &st_template;
tpnt->device = SDp;
@@ -4185,7 +4189,7 @@ static int st_probe(struct device *dev)
idr_preload_end();
if (error < 0) {
pr_warn("st: idr allocation failed: %d\n", error);
- goto out_put_disk;
+ goto out_put_queue;
}
tpnt->index = error;
sprintf(disk->disk_name, "st%d", tpnt->index);
@@ -4211,6 +4215,8 @@ out_remove_devs:
spin_lock(&st_index_lock);
idr_remove(&st_index_idr, tpnt->index);
spin_unlock(&st_index_lock);
+out_put_queue:
+ blk_put_queue(disk->queue);
out_put_disk:
put_disk(disk);
kfree(tpnt);