@@ -339,7 +339,10 @@ sysfs_get_tgt_nodename(struct path *pp, char *node)
struct udev_device *parent, *tgtdev;
int host, channel, tgtid = -1;
- parent = udev_device_get_parent_with_subsystem_devtype(pp->udev, "scsi", "scsi_device");
+ if (!pp->udev)
+ return 1;
+ parent = udev_device_get_parent_with_subsystem_devtype(pp->udev,
+ "scsi", "scsi_device");
if (!parent)
return 1;
/* Check for SAS */
@@ -1378,7 +1381,8 @@ nvme_sysfs_pathinfo (struct path *pp, const struct _vector *hwtable)
const char *attr_path = NULL;
const char *attr;
- attr_path = udev_device_get_sysname(pp->udev);
+ if (pp->udev)
+ attr_path = udev_device_get_sysname(pp->udev);
if (!attr_path)
return PATHINFO_FAILED;
@@ -1958,6 +1962,9 @@ static ssize_t uid_fallback(struct path *pp, int path_state,
}
} else if (pp->bus == SYSFS_BUS_NVME) {
char value[256];
+
+ if (!pp->udev)
+ return -1;
len = sysfs_attr_get_value(pp->udev, "wwid", value,
sizeof(value));
if (len <= 0)
@@ -188,9 +188,11 @@ retry:
int do_inquiry(const struct path *pp, int evpd, unsigned int codepage,
void *resp, int resplen, unsigned int timeout)
{
- struct udev_device *ud;
+ struct udev_device *ud = NULL;
- ud = udev_device_get_parent_with_subsystem_devtype(pp->udev, "scsi",
+ if (pp->udev)
+ ud = udev_device_get_parent_with_subsystem_devtype(pp->udev,
+ "scsi",
"scsi_device");
if (ud != NULL) {
int rc;
@@ -494,7 +494,7 @@ int verify_paths(struct multipath *mpp, struct vectors *vecs)
/*
* see if path is in sysfs
*/
- if (sysfs_attr_get_value(pp->udev, "dev",
+ if (!pp->udev || sysfs_attr_get_value(pp->udev, "dev",
pp->dev_t, BLK_DEV_SIZE) < 0) {
if (pp->state != PATH_DOWN) {
condlog(1, "%s: removing valid path %s in state %d",