summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2012-06-21 13:52:19 +0200
committerZdenek Kabelac <zkabelac@redhat.com>2012-08-23 14:37:52 +0200
commit243cd3fd2ca377d93fd7407f2a0109a04a189cbc (patch)
treef58af1ed087a20a91d81c78d2826f3b93ef607f8
parent132306c8887ac7279edd515a9f5c5de75dfc463a (diff)
downloadlvm2-243cd3fd2ca377d93fd7407f2a0109a04a189cbc.zip
lvm2-243cd3fd2ca377d93fd7407f2a0109a04a189cbc.tar.gz
lvm2-243cd3fd2ca377d93fd7407f2a0109a04a189cbc.tar.xz
cleanup: format1 test whether PV was found
Avoid dereferecing NULL pointer.
-rw-r--r--lib/format1/import-extents.c5
1 files changed, 4 insertions, 1 deletions
diff --git a/lib/format1/import-extents.c b/lib/format1/import-extents.c
index 46c1b7b..f0f4f65 100644
--- a/lib/format1/import-extents.c
+++ b/lib/format1/import-extents.c
@@ -118,7 +118,10 @@ static int _fill_maps(struct dm_hash_table *maps, struct volume_group *vg,
uint32_t i, lv_num, le;
dm_list_iterate_items(dl, pvds) {
- pv = find_pv(vg, dl->dev);
+ if (!(pv = find_pv(vg, dl->dev))) {
+ log_error("PV %s not found.", dl->dev->pvid);
+ return 0;
+ }
e = dl->extents;
/* build an array of lv's for this pv */