1
0
mirror of git://sourceware.org/git/lvm2.git synced 2024-12-21 13:34:40 +03:00

dmsetup: do not start dmfilemapd if region creation fails (coverity)

This commit is contained in:
Bryn M. Reeves 2017-03-29 18:21:17 +01:00
parent 6740eb1c2b
commit 11749e7adb

View File

@ -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++;