summaryrefslogtreecommitdiffstats
path: root/lib/cache/lvmcache.c
diff options
context:
space:
mode:
authorZdenek Kabelac <zkabelac@redhat.com>2012-06-21 12:43:31 +0200
committerZdenek Kabelac <zkabelac@redhat.com>2012-08-23 14:37:52 +0200
commitfd417db274e9a75f33f661b475aeebfd3d9eae45 (patch)
tree0a141abbc4fca181dd8ebd93859a7723caceee0f /lib/cache/lvmcache.c
parent15891d366d34fa6ea7235ec803ee0c5445a17101 (diff)
downloadlvm2-fd417db274e9a75f33f661b475aeebfd3d9eae45.tar.gz
lvm2-fd417db274e9a75f33f661b475aeebfd3d9eae45.tar.xz
lvm2-fd417db274e9a75f33f661b475aeebfd3d9eae45.zip
check: add internal errors for unexpected paths
Adding couple INTERNAL_ERROR reports for unwanted parameters: Ensure the 'top' metadata node cannot be NULL for lvmetad. Make obvious vginfo2 cannot be NULL. Report internal error if handler and vg is undefined. Check for handle in poll_vg(). Ensure seg is not NULL in dev_manager_transient(). Report missing read_ahead for _lv_read_ahead_single(). Check for report handler in dm_report_object(). Check missing VG in _vgreduce_single().
Diffstat (limited to 'lib/cache/lvmcache.c')
-rw-r--r--lib/cache/lvmcache.c12
1 files changed, 7 insertions, 5 deletions
diff --git a/lib/cache/lvmcache.c b/lib/cache/lvmcache.c
index 8936809b..6f9cfada 100644
--- a/lib/cache/lvmcache.c
+++ b/lib/cache/lvmcache.c
@@ -1005,12 +1005,14 @@ static int _free_vginfo(struct lvmcache_vginfo *vginfo)
vginfo->vgname);
r = 0;
}
- } else do
- if (vginfo2->next == vginfo) {
- vginfo2->next = vginfo->next;
- break;
+ } else
+ while (vginfo2) {
+ if (vginfo2->next == vginfo) {
+ vginfo2->next = vginfo->next;
+ break;
+ }
+ vginfo2 = vginfo2->next;
}
- while ((vginfo2 = vginfo2->next));
dm_free(vginfo->vgname);
dm_free(vginfo->creation_host);