Skip to contentSkip to conversation

master - coverity: check cmd pointer exists

PATCH Zdenek Kabelac 1 participant 1 message Feb 23, 2016

lore
Share & tools
lore
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=a9634e993a44760e164f0ed12aaeaa6903cc9a6e
Commit:        a9634e993a44760e164f0ed12aaeaa6903cc9a6e
Parent:        68955a81024d43138ee29b682d08233baf5ee876
Author:        Zdenek Kabelac <[email protected]>
AuthorDate:    Tue Feb 23 21:02:36 2016 +0100
Committer:     Zdenek Kabelac <[email protected]>
CommitterDate: Tue Feb 23 21:40:16 2016 +0100

coverity: check cmd pointer exists

Since in _report_init() we check few times for cmd != NULL keep it consistent and Coverity happier.

---
 tools/dmsetup.c |    2 +-
 1 files changed, 1 insertions(+), 1 deletions(-)
tools/dmsetup.c +1 -1
index 4db6004..b61b42f 100644
@@ -4384,7 +4384,7 @@ static int _report_init(const struct command *cmd, const char *subcommand)
 				selection, NULL, NULL)))
 		goto_out;
 
-	if ((_report_type & DR_TREE) && !_build_whole_deptree(cmd)) {
+	if ((_report_type & DR_TREE) && cmd && !_build_whole_deptree(cmd)) {
 		err("Internal device dependency tree creation failed.");
 		goto out;
 	}