Skip to contentSkip to conversation

SCSI fixes for 6.5-rc3

GIT PULL Merged James Bottomley 2 participants 2 messages Jul 24, 2023

Subsystems (2)
lore
Share & tools
lore

James Bottomley

author maintainer
#0 lore raw

Single fix for a potential regression over a misunderstanding of the blk_get_queue() api.

The patch is available here:

git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi.git scsi-fixes

The short changelog is:

Yu Kuai (1):
scsi: sg: Fix checking return value of blk_get_queue()

And the diffstat:

 drivers/scsi/sg.c | 7 ++++---
 1 file changed, 4 insertions(+), 3 deletions(-)

With full diff below.

James

---

drivers/scsi/sg.c +2 -3
index 89fa046c7158..0d8afffd1683 100644
@@ -1497,9 +1497,10 @@ sg_add_device(struct device *cl_dev)
 	int error;
 	unsigned long iflags;
 
-	error = blk_get_queue(scsidp->request_queue);
-	if (error)
-		return error;
+	if (!blk_get_queue(scsidp->request_queue)) {
+		pr_warn("%s: get scsi_device queue failed\n",

__func__);
+ return -ENODEV;
+ }

error = -ENOMEM;
cdev = cdev_alloc();