Skip to content

Commit fd1d6b9

Browse files
haiyuewatorvalds
authored andcommitted
xz: fix arm fdt compile error for kmalloc replacement
Align to the commit bf4afc5 ("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: Haiyue Wang <haiyuewa@163.com> Fixes: 69050f8 ("treewide: Replace kmalloc with kmalloc_obj for non-scalar types") Fixes: bf4afc5 ("Convert 'alloc_obj' family to use the new default GFP_KERNEL argument") Reviewed-by: Kees Cook <kees@kernel.org> Acked-by: Lasse Collin <lasse.collin@tukaani.org> Signed-off-by: Linus Torvalds <torvalds@linux-foundation.org>
1 parent 5f2eac7 commit fd1d6b9

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

lib/decompress_unxz.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -157,11 +157,11 @@
157157
* when XZ_DYNALLOC is used, but the pre-boot free() doesn't support it.
158158
* Workaround it here because the other decompressors don't need it.
159159
*/
160-
#undef kmalloc
160+
#undef kmalloc_obj
161161
#undef kfree
162162
#undef vmalloc
163163
#undef vfree
164-
#define kmalloc(size, flags) malloc(size)
164+
#define kmalloc_obj(type) malloc(sizeof(type))
165165
#define kfree(ptr) free(ptr)
166166
#define vmalloc(size) malloc(size)
167167
#define vfree(ptr) do { if (ptr != NULL) free(ptr); } while (0)

0 commit comments

Comments
 (0)