Skip to content

Commit 0b5547c

Browse files
committed
Merge tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi
Pull SCSI fix from James Bottomley: "A single fix for a potential regression over a misunderstanding of the blk_get_queue() api" * tag 'scsi-fixes' of git://git.kernel.org/pub/scm/linux/kernel/git/jejb/scsi: scsi: sg: Fix checking return value of blk_get_queue()
2 parents 20ea1e7 + 80b6051 commit 0b5547c

File tree

1 file changed

+4
-3
lines changed

1 file changed

+4
-3
lines changed

drivers/scsi/sg.c

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1497,9 +1497,10 @@ sg_add_device(struct device *cl_dev)
14971497
int error;
14981498
unsigned long iflags;
14991499

1500-
error = blk_get_queue(scsidp->request_queue);
1501-
if (error)
1502-
return error;
1500+
if (!blk_get_queue(scsidp->request_queue)) {
1501+
pr_warn("%s: get scsi_device queue failed\n", __func__);
1502+
return -ENODEV;
1503+
}
15031504

15041505
error = -ENOMEM;
15051506
cdev = cdev_alloc();

0 commit comments

Comments
 (0)