summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryn M. Reeves <bmr@redhat.com>2015-08-17 18:33:22 +0100
committerBryn M. Reeves <bmr@redhat.com>2015-08-17 18:37:16 +0100
commit074b5de7715b76ad63147f84edb5d9e1a05870e9 (patch)
tree5dd1a6460e4f0cbdc88dce05da19934d4f97626f
parent69fa16048a61b6cd0b8fe9c311dd4e9eea532207 (diff)
downloadlvm2-074b5de7715b76ad63147f84edb5d9e1a05870e9.tar.gz
libdm: check for zero in _nr_areas() (Coverity)
-rw-r--r--libdm/libdm-stats.c3
1 files changed, 3 insertions, 0 deletions
diff --git a/libdm/libdm-stats.c b/libdm/libdm-stats.c
index b7000cc80..ba213b773 100644
--- a/libdm/libdm-stats.c
+++ b/libdm/libdm-stats.c
@@ -504,6 +504,9 @@ out:
static uint64_t _nr_areas(uint64_t len, uint64_t step)
{
+ /* Default is one area. */
+ if (!len || !step)
+ return 1;
/*
* drivers/md/dm-stats.c::message_stats_create()
* A region may be sub-divided into areas with their own counters.