This is a note to let you know that I've just added the patch titled scsi: bsg: Fix errno when scsi_bsg_register_queue() fails to the 5.15-stable tree which can be found at: http://www.kernel.org/git/?p=linux/kernel/git/stable/stable-queue.git;a=summary The filename of the patch is: scsi-bsg-fix-errno-when-scsi_bsg_register_queue-fail.patch and it can be found in the queue-5.15 subdirectory. If you, or anyone else, feels it should not be added to the stable tree, please let <stable@xxxxxxxxxxxxxxx> know about it. commit c1726d9e4a7900ccde2e2d4969cd5c3cc8607fa5 Author: Jackie Liu <liuyun01@xxxxxxxxxx> Date: Fri Oct 22 09:02:01 2021 +0800 scsi: bsg: Fix errno when scsi_bsg_register_queue() fails [ Upstream commit 5f7cf82c1d7373fcf9e1062f5654efd5fa2b9211 ] When the value of error is printed, it will always be 0. We should print the correct error code when scsi_bsg_register_queue() fails. Link: https://lore.kernel.org/r/20211022010201.426746-1-liu.yun@xxxxxxxxx Fixes: ead09dd3aed5 ("scsi: bsg: Simplify device registration") Cc: Jens Axboe <axboe@xxxxxxxxx> Cc: Christoph Hellwig <hch@xxxxxx> Reviewed-by: Christoph Hellwig <hch@xxxxxx> Signed-off-by: Jackie Liu <liuyun01@xxxxxxxxxx> Signed-off-by: Martin K. Petersen <martin.petersen@xxxxxxxxxx> Signed-off-by: Sasha Levin <sashal@xxxxxxxxxx> diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c index a35841b34bfd9..8bb79ccc9a8b5 100644 --- a/drivers/scsi/scsi_sysfs.c +++ b/drivers/scsi/scsi_sysfs.c @@ -1388,6 +1388,7 @@ int scsi_sysfs_add_sdev(struct scsi_device *sdev) * We're treating error on bsg register as non-fatal, so * pretend nothing went wrong. */ + error = PTR_ERR(sdev->bsg_dev); sdev_printk(KERN_INFO, sdev, "Failed to register bsg queue, errno=%d\n", error);