Commit fd1d6b9d authored by Haiyue Wang's avatar Haiyue Wang Committed by Linus Torvalds
Browse files

xz: fix arm fdt compile error for kmalloc replacement



Align to the commit bf4afc53 ("Convert 'alloc_obj' family to use the
new default GFP_KERNEL argument") update the 'kmalloc_obj' declaration
for userspace to fix below compile error:

  In file included from arch/arm/boot/compressed/../../../../lib/decompress_unxz.c:241,
                   from arch/arm/boot/compressed/decompress.c:56:
  arch/arm/boot/compressed/../../../../lib/xz/xz_dec_stream.c: In function 'xz_dec_init':
  arch/arm/boot/compressed/../../../../lib/xz/xz_dec_stream.c:787:28: error: implicit declaration of function 'kmalloc_obj'; did you mean 'kmalloc'? [-Wimplicit-function-declaration]
     787 |         struct xz_dec *s = kmalloc_obj(*s);
         |                            ^~~~~~~~~~~
         |                            kmalloc

Signed-off-by: default avatarHaiyue Wang <haiyuewa@163.com>
Fixes: 69050f8d ("treewide: Replace kmalloc with kmalloc_obj for non-scalar types")
Fixes: bf4afc53 ("Convert 'alloc_obj' family to use the new default GFP_KERNEL argument")
Reviewed-by: default avatarKees Cook <kees@kernel.org>
Acked-by: default avatarLasse Collin <lasse.collin@tukaani.org>
Signed-off-by: default avatarLinus Torvalds <torvalds@linux-foundation.org>
parent 5f2eac77
Loading
Loading
Loading
Loading
+2 −2
Original line number Diff line number Diff line
@@ -157,11 +157,11 @@
 * when XZ_DYNALLOC is used, but the pre-boot free() doesn't support it.
 * Workaround it here because the other decompressors don't need it.
 */
#undef kmalloc
#undef kmalloc_obj
#undef kfree
#undef vmalloc
#undef vfree
#define kmalloc(size, flags) malloc(size)
#define kmalloc_obj(type) malloc(sizeof(type))
#define kfree(ptr) free(ptr)
#define vmalloc(size) malloc(size)
#define vfree(ptr) do { if (ptr != NULL) free(ptr); } while (0)