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()
This commit is contained in:
Linus Torvalds
2023-07-24 14:38:41 -07:00

View File

@@ -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();