diff options
author | Jackie Liu <liuyun01@kylinos.cn> | 2021-10-22 09:02:01 +0800 |
---|---|---|
committer | Martin K. Petersen <martin.petersen@oracle.com> | 2021-11-03 21:30:16 -0400 |
commit | 5f7cf82c1d7373fcf9e1062f5654efd5fa2b9211 (patch) | |
tree | 6cd4cd1ea957dda849d361271c5c4f726ca7fba6 /drivers/scsi/scsi_sysfs.c | |
parent | a1efc896cb8a2831de3cf5a9747e030b494f1a26 (diff) | |
download | lwn-5f7cf82c1d7373fcf9e1062f5654efd5fa2b9211.tar.gz lwn-5f7cf82c1d7373fcf9e1062f5654efd5fa2b9211.zip |
scsi: bsg: Fix errno when scsi_bsg_register_queue() fails
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@linux.dev
Fixes: ead09dd3aed5 ("scsi: bsg: Simplify device registration")
Cc: Jens Axboe <axboe@kernel.dk>
Cc: Christoph Hellwig <hch@lst.de>
Reviewed-by: Christoph Hellwig <hch@lst.de>
Signed-off-by: Jackie Liu <liuyun01@kylinos.cn>
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
Diffstat (limited to 'drivers/scsi/scsi_sysfs.c')
-rw-r--r-- | drivers/scsi/scsi_sysfs.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c index fa064bf9a55c..f06639d21e11 100644 --- a/drivers/scsi/scsi_sysfs.c +++ b/drivers/scsi/scsi_sysfs.c @@ -1374,6 +1374,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); |