From f50af80199f723f7b1970ee33ddf959ea79fcbef Mon Sep 17 00:00:00 2001 From: David Teigland Date: Wed, 16 Oct 2019 13:32:28 -0500 Subject: [PATCH 134/180] devs: check for no dev when dropping aliases When scanning fails to find a device path and looks for device aliases, check if the device itself still exists to avoid a potential segfault. --- lib/label/label.c | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/lib/label/label.c b/lib/label/label.c index 8107e33..e4a1068 100644 --- a/lib/label/label.c +++ b/lib/label/label.c @@ -734,6 +734,11 @@ static int _scan_list(struct cmd_context *cmd, struct dev_filter *f, retried_open = 1; dm_list_iterate_items_safe(devl, devl2, &reopen_devs) { + if (!devl->dev) { + dm_list_del(&devl->list); + continue; + } + _drop_bad_aliases(devl->dev); if (dm_list_empty(&devl->dev->aliases)) { -- 1.8.3.1