All of lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH v2] scsi: bsg: fix errno when scsi_bsg_register_queue fails
@ 2021-10-22  1:02 Jackie Liu
  2021-12-22 16:54 ` Guenter Roeck
  0 siblings, 1 reply; 7+ messages in thread
From: Jackie Liu @ 2021-10-22  1:02 UTC (permalink / raw)
  To: martin.petersen; +Cc: linux-scsi, hch, axboe, liu.yun

From: Jackie Liu <liuyun01@kylinos.cn>

When the value of error is printed, it will always be 0. Here, we should be
print the correct error code when scsi_bsg_register_queue fails.

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>
---
 v1->v2:
 resend to linux-scsi mail list.

 drivers/scsi/scsi_sysfs.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/scsi/scsi_sysfs.c b/drivers/scsi/scsi_sysfs.c
index 86793259e541..d8789f6cda62 100644
--- a/drivers/scsi/scsi_sysfs.c
+++ b/drivers/scsi/scsi_sysfs.c
@@ -1379,6 +1379,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);
-- 
2.25.1


^ permalink raw reply related	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-12-23  6:33 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2021-10-22  1:02 [PATCH v2] scsi: bsg: fix errno when scsi_bsg_register_queue fails Jackie Liu
2021-12-22 16:54 ` Guenter Roeck
2021-12-23  1:07   ` Jackie Liu
2021-12-23  1:35     ` Guenter Roeck
2021-12-23  2:42       ` Jackie Liu
2021-12-23  3:13         ` Jackie Liu
2021-12-23  6:33         ` Christoph Hellwig

This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.