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

libdm: check for zero in _nr_areas() (Coverity)

This commit is contained in:
Bryn M. Reeves 2015-08-17 18:33:22 +01:00
parent 69fa16048a
commit 074b5de771

View File

@ -504,6 +504,9 @@ out:
static uint64_t _nr_areas(uint64_t len, uint64_t step) 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() * drivers/md/dm-stats.c::message_stats_create()
* A region may be sub-divided into areas with their own counters. * A region may be sub-divided into areas with their own counters.