master - libdm: check for zero in _nr_areas() (Coverity)
Gitweb: http://git.fedorahosted.org/git/?p=lvm2.git;a=commitdiff;h=074b5de7715b76ad63147f84edb5d9e1a05870e9 Commit: 074b5de7715b76ad63147f84edb5d9e1a05870e9 Parent: 69fa16048a61b6cd0b8fe9c311dd4e9eea532207 Author: Bryn M. Reeves <[email protected]> AuthorDate: Mon Aug 17 18:33:22 2015 +0100 Committer: Bryn M. Reeves <[email protected]> CommitterDate: Mon Aug 17 18:37:16 2015 +0100
libdm: check for zero in _nr_areas() (Coverity)
--- libdm/libdm-stats.c | 3 +++ 1 files changed, 3 insertions(+), 0 deletions(-)
libdm/libdm-stats.c +3 -0
@@ -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.