summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryn M. Reeves <bmr@redhat.com>2017-03-29 18:21:17 +0100
committerBryn M. Reeves <bmr@redhat.com>2017-03-29 18:34:51 +0100
commit11749e7adbafc36452451de0f73a6a5197c73810 (patch)
treef57cc773c74eeb39d43ec75b4ac21f326ca4665c
parent6740eb1c2b8cde6aabce0d9b0847c01b69210065 (diff)
downloadlvm2-11749e7adbafc36452451de0f73a6a5197c73810.tar.gz
dmsetup: do not start dmfilemapd if region creation fails (coverity)
-rw-r--r--tools/dmsetup.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/tools/dmsetup.c b/tools/dmsetup.c
index 94787dc7f..a6ed172fc 100644
--- a/tools/dmsetup.c
+++ b/tools/dmsetup.c
@@ -5110,6 +5110,11 @@ static int _stats_create_file(CMD_ARGS)
regions = dm_stats_create_regions_from_fd(dms, fd, group, precise,
bounds, alias);
+ if (!regions) {
+ log_error("Could not create regions from file %s", abspath);
+ goto bad;
+ }
+
if (!_switches[NOMONITOR_ARG] && group) {
if (!dm_stats_start_filemapd(fd, regions[0], abspath, mode,
foreground, verbose))
@@ -5121,11 +5126,6 @@ static int _stats_create_file(CMD_ARGS)
fd = -1;
- if (!regions) {
- log_error("Could not create regions from file %s", abspath);
- goto bad;
- }
-
for (region = regions; *region != DM_STATS_REGIONS_ALL; region++)
count++;