]> git.apps.os.sepia.ceph.com Git - ceph.git/commit
crush/CrushCompiler.cc: fix error handling
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Thu, 11 May 2017 13:29:56 +0000 (15:29 +0200)
committerKefu Chai <kchai@redhat.com>
Sat, 2 Sep 2017 04:27:15 +0000 (12:27 +0800)
commitb520cfae5e9b9e2e1ab8d51279d60e6437ff629d
tree3a8a186264ebe98897601e157abfac62d503130d
parent9cb79067dc009b488c9dc2d0c4641da88153bfca
crush/CrushCompiler.cc: fix error handling

calloc() does not take negative values, check return value from
get_max_buckets() and handle it correctly.

Fix for:

CID 1405301 (#1 of 1): Argument cannot be negative (NEGATIVE_RETURNS)
 negative_returns: arg_map.size is passed to a parameter that cannot
 be negative.

Signed-off-by: Danny Al-Gaaf <danny.al-gaaf@bisect.de>
src/crush/CrushCompiler.cc