Skip to contentSkip to conversation

master - coverity: is_used_pv needs valid pv pointer

PATCH Zdenek Kabelac 1 participant 1 message Apr 22, 2016

lore
Share & tools
lore
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=d564d9f39c73bdbb32413256586991993ad869ef
Commit:        d564d9f39c73bdbb32413256586991993ad869ef
Parent:        2dc6b9785658d7bf0cf97170e8e1467b522bded6
Author:        Zdenek Kabelac <[email protected]>
AuthorDate:    Thu Apr 21 20:23:13 2016 +0200
Committer:     Zdenek Kabelac <[email protected]>
CommitterDate: Fri Apr 22 14:15:36 2016 +0200

coverity: is_used_pv needs valid pv pointer

---
 lib/report/report.c |    5 ++---
 1 files changed, 2 insertions(+), 3 deletions(-)
lib/report/report.c +2 -3
index 08a6097..abf6a9e 100644
@@ -3827,10 +3827,9 @@ int report_object(void *handle, int selection_only, const struct volume_group *v
 			_dummy_fid.fmt = pv->fmt;
 	}
 
-	if (vg && is_orphan_vg(vg->name) && is_used_pv(pv)) {
+	if (vg && is_orphan_vg(vg->name) && pv && is_used_pv(pv)) {
 		obj.vg = &_unknown_vg;
-		if (pv)
-			_dummy_fid.fmt = pv->fmt;
+		_dummy_fid.fmt = pv->fmt;
 	}
 
 	return sh ? dm_report_object_is_selected(sh->selection_rh, &obj, 0, &sh->selected)