[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <lsq.1510009382.336622240@decadent.org.uk>
Date: Mon, 06 Nov 2017 23:03:02 +0000
From: Ben Hutchings <ben@...adent.org.uk>
To: linux-kernel@...r.kernel.org, stable@...r.kernel.org
CC: akpm@...ux-foundation.org,
"Kai Mäkisara" <kai.makisara@...umbus.fi>,
"Bodo Stroesser" <bstroesser@...fujitsu.com>,
"Hannes Reinecke" <hare@...e.com>,
"Shirish Pargaonkar" <spargaonkar@...e.com>,
"Martin K. Petersen" <martin.petersen@...cle.com>,
"Ewan D. Milne" <emilne@...hat.com>
Subject: [PATCH 3.16 100/294] scsi: st: fix blk_get_queue usage
3.16.50-rc1 review patch. If anyone has any objections, please let me know.
------------------
From: Bodo Stroesser <bstroesser@...fujitsu.com>
commit 180efde0a3f43dbe533e4be203c2918793482d4e upstream.
If blk_queue_get() in st_probe fails, disk->queue must not be set to
SDp->request_queue, as that would result in put_disk() dropping a not
taken reference.
Thus, disk->queue should be set only after a successful blk_queue_get().
Fixes: 2b5bebccd282 ("st: Take additional queue ref in st_probe")
Signed-off-by: Bodo Stroesser <bstroesser@...fujitsu.com>
Acked-by: Shirish Pargaonkar <spargaonkar@...e.com>
Signed-off-by: Hannes Reinecke <hare@...e.com>
Reviewed-by: Ewan D. Milne <emilne@...hat.com>
Acked-by: Kai Mäkisara <kai.makisara@...umbus.fi>
Signed-off-by: Martin K. Petersen <martin.petersen@...cle.com>
Signed-off-by: Ben Hutchings <ben@...adent.org.uk>
---
drivers/scsi/st.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
--- a/drivers/scsi/st.c
+++ b/drivers/scsi/st.c
@@ -4115,11 +4115,11 @@ static int st_probe(struct device *dev)
kref_init(&tpnt->kref);
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))
+ if (!blk_get_queue(SDp->request_queue))
goto out_put_disk;
+ disk->queue = SDp->request_queue;
tpnt->driver = &st_template;
tpnt->device = SDp;
Powered by blists - more mailing lists