Skip to contentSkip to conversation

master - dmsetup: remove bogus !_report test in _stats_report (Coverity)

PATCH Bryn Reeves 1 participant 1 message Aug 10, 2015

lore
Share & tools
lore
#0 lore raw
Gitweb:        http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=3b74824985f7e4e90f0ba9668724abd08d5fef74
Commit:        3b74824985f7e4e90f0ba9668724abd08d5fef74
Parent:        6bd5bf3cb5a1c01ec8be8bb714c7c0461d6bec58
Author:        Bryn M. Reeves <[email protected]>
AuthorDate:    Mon Aug 10 10:01:18 2015 +0100
Committer:     Bryn M. Reeves <[email protected]>
CommitterDate: Mon Aug 10 20:12:53 2015 +0100

dmsetup: remove bogus !_report test in _stats_report (Coverity)

There's no point testing _report here in _stats_report: it's always initialised before the function is called and if the check did fail we'd end up freeing an uninitialized dm_task in the error path.

tools/dmsetup.c: 4389 in _stats_report() - Declaring variable "dmt" without initializer.

---
 tools/dmsetup.c |    3 ---
 1 files changed, 0 insertions(+), 3 deletions(-)
tools/dmsetup.c +0 -3
index de67b03..2ee432b 100644
@@ -4397,9 +4397,6 @@ static int _stats_report(CMD_ARGS)
 		name = argv[1];
 	}
 
-	if (!_report)
-		goto out;
-
 	if (!(dmt = dm_task_create(DM_DEVICE_INFO)))
 		return 0;