[PATCH] dm mpath: potential NULL dereference with parse_path()

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



We forgot to set the error code on this path so it means we accidentally
return NULL.  The caller is expecting error pointers and will crash
with a NULL dereference.

Fixes: faf782b1c93d ("dm mpath: optimize NVMe bio-based support")
Signed-off-by: Dan Carpenter <dan.carpenter@xxxxxxxxxx>

diff --git a/drivers/md/dm-mpath.c b/drivers/md/dm-mpath.c
index d1f32103ae86..0436a5466281 100644
--- a/drivers/md/dm-mpath.c
+++ b/drivers/md/dm-mpath.c
@@ -883,6 +883,7 @@ static struct pgpath *parse_path(struct dm_arg_set *as, struct path_selector *ps
 		INIT_DELAYED_WORK(&p->activate_path, activate_path_work);
 		if (setup_scsi_dh(p->path.dev->bdev, m, &ti->error)) {
 			dm_put_device(ti, p->path.dev);
+			r = -EINVAL;
 			goto bad;
 		}
 	}
--
To unsubscribe from this list: send the line "unsubscribe kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html



[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux