scsi: device_handler: Return error pointer in scsi_dh_attached_handler_name()
authorBenjamin Marzinski <bmarzins@redhat.com>
Sat, 6 Dec 2025 01:00:15 +0000 (20:00 -0500)
committerMartin K. Petersen <martin.petersen@oracle.com>
Tue, 9 Dec 2025 03:04:38 +0000 (22:04 -0500)
commitfd81bc5cca8fc6936a8988de6b5d4c5693b6587e
treed3274b4d10ea275f01b9508011814573b74d112b
parentd2875b812b141d0c449541976d92c8d89b94ec72
scsi: device_handler: Return error pointer in scsi_dh_attached_handler_name()

If scsi_dh_attached_handler_name() fails to allocate the handler name,
dm-multipath (its only caller) assumes there is no attached device
handler, and sets the device up incorrectly. Return an error pointer
instead, so multipath can distinguish between failure, success where
there is no attached device handler, or when the path device is not a
SCSI device at all.

Signed-off-by: Benjamin Marzinski <bmarzins@redhat.com>
Reviewed-by: Martin Wilck <mwilck@suse.com>
Link: https://patch.msgid.link/20251206010015.1595225-1-bmarzins@redhat.com
Signed-off-by: Martin K. Petersen <martin.petersen@oracle.com>
drivers/md/dm-mpath.c
drivers/scsi/scsi_dh.c