]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
histogram.h: fix potential div by zero
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Fri, 28 Feb 2014 23:19:58 +0000 (00:19 +0100)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Fri, 28 Feb 2014 23:19:58 +0000 (00:19 +0100)
commit7eefe85cf53ef58349fb44af2ac60d7ebb9f5960
tree21e557905c307190909067ec5a64e8a93f24cbb2
parent500206d809f0cd85cd99e4f0ec164bbf74f92c28
histogram.h: fix potential div by zero

CID 1188131 (#1 of 1): Division or modulo by zero (DIVIDE_BY_ZERO)
 divide_by_zero: In expression "lower_sum * 1000000UL / total", division
 by expression "total" which may be zero has undefined behavior

Added check for non zero total.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
src/common/histogram.h