stable-2.02 - devs: check for no dev when dropping aliases
Gitweb: https://sourceware.org/git/?p=lvm2.git;a=commitdiff;h=f50af80199f723f7b1970ee33ddf959ea79fcbef Commit: f50af80199f723f7b1970ee33ddf959ea79fcbef Parent: 219c4c2ce2c605960ad760ac99be27b2665a8c43 Author: David Teigland <[email protected]> AuthorDate: Wed Oct 16 13:32:28 2019 -0500 Committer: David Teigland <[email protected]> CommitterDate: Wed Oct 16 13:32:28 2019 -0500
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 files changed, 5 insertions(+), 0 deletions(-)
lib/label/label.c +5 -0
@@ -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)) {