From 8e3db44036f46ac750dcf7bece32e23063455959 Mon Sep 17 00:00:00 2001 From: Peter Rajnoha Date: Tue, 15 Oct 2024 10:58:16 +0200 Subject: [PATCH] device_id: fix segfault if devices file has PVID=. --- lib/device/device_id.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/device/device_id.c b/lib/device/device_id.c index 544e7bc19..a360cc2a6 100644 --- a/lib/device/device_id.c +++ b/lib/device/device_id.c @@ -3374,7 +3374,7 @@ void device_ids_validate(struct cmd_context *cmd, struct dm_list *scanned_devs, int found_scanned = 1; dm_list_iterate_items(devl, scanned_devs) { du = get_du_for_dev(cmd, devl->dev); - if (du && !memcmp(du->pvid, devl->dev->pvid, ID_LEN)) + if (du && du->pvid && !memcmp(du->pvid, devl->dev->pvid, ID_LEN)) continue; found_scanned = 0; break;