]> git.apps.os.sepia.ceph.com Git - ceph.git/commitdiff
CrushWrapper.cc: fix sizeof() call in calloc
authorDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Sat, 10 May 2014 08:50:32 +0000 (10:50 +0200)
committerDanny Al-Gaaf <danny.al-gaaf@bisect.de>
Sat, 10 May 2014 08:50:32 +0000 (10:50 +0200)
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 <danny.al-gaaf@bisect.de>
src/crush/CrushWrapper.cc

index b5ecbc66fc23ad4c71a2f4a9dcb4d59f3f7d5627..c0eabe37f51aa149bce0b11f34af2ac4655ed294 100644 (file)
@@ -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) {