diff options
author | Bryn M. Reeves <bmr@redhat.com> | 2015-08-17 18:33:22 +0100 |
---|---|---|
committer | Bryn M. Reeves <bmr@redhat.com> | 2015-08-17 18:37:16 +0100 |
commit | 074b5de7715b76ad63147f84edb5d9e1a05870e9 (patch) | |
tree | 5dd1a6460e4f0cbdc88dce05da19934d4f97626f | |
parent | 69fa16048a61b6cd0b8fe9c311dd4e9eea532207 (diff) | |
download | lvm2-074b5de7715b76ad63147f84edb5d9e1a05870e9.tar.gz |
libdm: check for zero in _nr_areas() (Coverity)
-rw-r--r-- | libdm/libdm-stats.c | 3 |
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. |