From a9634e993a44760e164f0ed12aaeaa6903cc9a6e Mon Sep 17 00:00:00 2001 From: Zdenek Kabelac Date: Tue, 23 Feb 2016 21:02:36 +0100 Subject: [PATCH] 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 file changed, 1 insertion(+), 1 deletion(-) diff --git a/tools/dmsetup.c b/tools/dmsetup.c index 4db60045f..b61b42f77 100644 --- a/tools/dmsetup.c +++ b/tools/dmsetup.c @@ -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; }