struct device *dev;
dev_t devt;
- if (!lv_info(cmd, lv, 0, &lvinfo, 0, 0))
- return;
-
- devt = MKDEV(lvinfo.major, lvinfo.minor);
- if ((dev = dev_cache_get_by_devt(cmd, devt, NULL, NULL)))
- label_scan_invalidate(dev);
+ if (lv_info(cmd, lv, 0, &lvinfo, 0, 0) && lvinfo.exists) {
+ /* FIXME: Still unclear what is it supposed to find */
+ devt = MKDEV(lvinfo.major, lvinfo.minor);
+ if ((dev = dev_cache_get_by_devt(cmd, devt, NULL, NULL)))
+ label_scan_invalidate(dev);
+ }
}
/*