diff options
author | David Teigland <teigland@redhat.com> | 2022-12-01 11:49:51 -0600 |
---|---|---|
committer | David Teigland <teigland@redhat.com> | 2022-12-01 11:49:51 -0600 |
commit | a74468116ea51542e409e4bc393c63dc7ddb20b6 (patch) | |
tree | db4aaf72a1c0bef578fba9cacc17733202141703 /lib | |
parent | e71b434663e445ee9232fc72786e5bc2ac699f4b (diff) | |
download | lvm2-a74468116ea51542e409e4bc393c63dc7ddb20b6.tar.gz |
device_id: check return value of label_read_pvid
for covscan
Diffstat (limited to 'lib')
-rw-r--r-- | lib/device/device_id.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/lib/device/device_id.c b/lib/device/device_id.c index 367b7dbb9..1f2ab5ad4 100644 --- a/lib/device/device_id.c +++ b/lib/device/device_id.c @@ -2489,6 +2489,7 @@ void device_ids_check_serial(struct cmd_context *cmd, struct dm_list *scan_devs, int has_pvid; int found; int count; + int err; dm_list_init(&dus_check); dm_list_init(&devs_check); @@ -2544,8 +2545,8 @@ void device_ids_check_serial(struct cmd_context *cmd, struct dm_list *scan_devs, dev = devl->dev; has_pvid = 0; - label_read_pvid(dev, &has_pvid); - if (!has_pvid) { + err = label_read_pvid(dev, &has_pvid); + if (!err || !has_pvid) { log_debug("serial %s no pvid %s", idname, dev_name(devl->dev)); dm_list_del(&devl->list); continue; |