]> git.sesse.net Git - bcachefs-tools-debian/commitdiff
Fix krealloc() alignment
authorKent Overstreet <kent.overstreet@gmail.com>
Thu, 8 Apr 2021 19:48:45 +0000 (15:48 -0400)
committerKent Overstreet <kent.overstreet@gmail.com>
Thu, 8 Apr 2021 19:48:45 +0000 (15:48 -0400)
bcachefs assumes kmalloc & krealloc give out allocations that are
naturally aligned, like the kernel allocators do.

Signed-off-by: Kent Overstreet <kent.overstreet@gmail.com>
include/linux/slab.h

index 775b7e3aa7829a0608455626f97c82ee41e4781a..6628d5e44a7914a4dc4d4679b86604b05ccd79cf 100644 (file)
@@ -40,7 +40,7 @@ static inline void *krealloc(void *old, size_t size, gfp_t flags)
 
        run_shrinkers();
 
-       new = malloc(size);
+       new = kmalloc(size, flags);
        if (!new)
                return NULL;