From 25a87ea16aba335b5f33621cd5ac6ff651f0bbb1 Mon Sep 17 00:00:00 2001 From: David Teigland Date: Fri, 6 Oct 2023 12:24:34 -0500 Subject: [PATCH] device_id: fix lvmdevices update segfault From commit 1901a47df12 "device_id: fix conditions for device_ids_refresh" --- lib/device/device_id.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/lib/device/device_id.c b/lib/device/device_id.c index 829794010..17f0c9bc6 100644 --- a/lib/device/device_id.c +++ b/lib/device/device_id.c @@ -2546,7 +2546,8 @@ void device_ids_validate(struct cmd_context *cmd, struct dm_list *scanned_devs, dev = du->dev; devname = dev_name(du->dev); - if (!device_list_find_dev(scanned_devs, du->dev) || (du->dev->flags & DEV_SCAN_NOT_READ)) { + if ((scanned_devs && !device_list_find_dev(scanned_devs, du->dev)) || + (du->dev->flags & DEV_SCAN_NOT_READ)) { log_debug("Validate %s %s PVID %s on %s: not scanned", idtype_to_str(du->idtype), du->idname ?: ".", du->pvid ?: ".", devname); } else {