From eb2def87f85e51fc4b33aa1f2ad06042f51517b7 Mon Sep 17 00:00:00 2001 From: Danny Al-Gaaf Date: Sat, 10 May 2014 10:50:32 +0200 Subject: [PATCH] CrushWrapper.cc: fix sizeof() call in calloc Use __u32 instead of __s32 due to type of bucket->parm to fix: 1028 bucket->perm = (__u32*)calloc(1, bucket->size * sizeof(__s32)); Result of 'calloc' is converted to a pointer of type '__u32', which is incompatible with sizeof operand type '__s32' Signed-off-by: Danny Al-Gaaf --- src/crush/CrushWrapper.cc | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/crush/CrushWrapper.cc b/src/crush/CrushWrapper.cc index b5ecbc66fc23..c0eabe37f51a 100644 --- a/src/crush/CrushWrapper.cc +++ b/src/crush/CrushWrapper.cc @@ -1025,7 +1025,7 @@ void CrushWrapper::decode_crush_bucket(crush_bucket** bptr, bufferlist::iterator ::decode(bucket->items[j], blp); } - bucket->perm = (__u32*)calloc(1, bucket->size * sizeof(__s32)); + bucket->perm = (__u32*)calloc(1, bucket->size * sizeof(__u32)); bucket->perm_n = 0; switch (bucket->alg) { -- 2.47.3