SCSI fixes on 20230724

Single fix for a potential regression over a misunderstanding of the
 blk_get_queue() api.
 
 Signed-off-by: James E.J. Bottomley <jejb@linux.ibm.com>
 -----BEGIN PGP SIGNATURE-----
 
 iJwEABMIAEQWIQTnYEDbdso9F2cI+arnQslM7pishQUCZL7MmSYcamFtZXMuYm90
 dG9tbGV5QGhhbnNlbnBhcnRuZXJzaGlwLmNvbQAKCRDnQslM7pishS5CAP9nqusg
 7fN/2nO7MdZNeZwHvNVmgBOVO7z4vPypCTN8oAEAvMQUcXjQFUuIm4qJalF0UPKv
 GxQjWcd2Pm7rYI6i/9Y=
 =/KLr
 -----END PGP SIGNATURE-----

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
commit 0b5547c518

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