On Tue, Feb 02, 2021 at 10:41:31PM +0100, mwilck@xxxxxxxx wrote: > From: Martin Wilck <mwilck@xxxxxxxx> > > udev_device_get_devnum() may fail, in which case it returns > makedev(0, 0). > Reviewed-by: Benjamin Marzinski <bmarzins@xxxxxxxxxx> > Signed-off-by: Martin Wilck <mwilck@xxxxxxxx> > --- > libmultipath/discovery.c | 3 +++ > 1 file changed, 3 insertions(+) > > diff --git a/libmultipath/discovery.c b/libmultipath/discovery.c > index 921025d..15cf641 100644 > --- a/libmultipath/discovery.c > +++ b/libmultipath/discovery.c > @@ -1659,6 +1659,9 @@ common_sysfs_pathinfo (struct path * pp) > return PATHINFO_FAILED; > } > devt = udev_device_get_devnum(pp->udev); > + if (major(devt) == 0 && minor(devt) == 0) > + return PATHINFO_FAILED; > + > snprintf(pp->dev_t, BLK_DEV_SIZE, "%d:%d", major(devt), minor(devt)); > > condlog(4, "%s: dev_t = %s", pp->dev, pp->dev_t); > -- > 2.29.2 -- dm-devel mailing list dm-devel@xxxxxxxxxx https://www.redhat.com/mailman/listinfo/dm-devel