From: Johannes Thumshirn Date: Fri, 23 Mar 2018 13:37:05 +0000 (+0100) Subject: scsi: scsi_dh: Don't look for NULL devices handlers by name X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=2ee5671e3ae35e53bb5a53a89ac8f033e4b1721f;p=linux.git scsi: scsi_dh: Don't look for NULL devices handlers by name Currently scsi_dh_lookup() doesn't check for NULL as a device name. This combined with nvme over dm-mpath results in the following messages emitted by device-mapper: device-mapper: multipath: Could not failover device 259:67: Handler scsi_dh_(null) error 14. Let scsi_dh_lookup() fail fast on NULL names. [mkp: typo fix] Cc: # v4.16 Signed-off-by: Johannes Thumshirn Reviewed-by: Hannes Reinecke Reviewed-by: Bart Van Assche Signed-off-by: Martin K. Petersen --- diff --git a/drivers/scsi/scsi_dh.c b/drivers/scsi/scsi_dh.c index b88b5dbbc444e..188f30572aa1f 100644 --- a/drivers/scsi/scsi_dh.c +++ b/drivers/scsi/scsi_dh.c @@ -112,6 +112,9 @@ static struct scsi_device_handler *scsi_dh_lookup(const char *name) { struct scsi_device_handler *dh; + if (!name || strlen(name) == 0) + return NULL; + dh = __scsi_dh_lookup(name); if (!dh) { request_module("scsi_dh_%s", name);