From nobody Fri Apr 17 07:45:45 2026 Received: from m16.mail.163.com (m16.mail.163.com [117.135.210.5]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 8202C7081E for ; Sun, 22 Feb 2026 12:12:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=117.135.210.5 ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771762364; cv=none; b=YLdG+INBc1DGiMjWNGlS/28nYC1zIaG5c1pWefW3Nhp9aQtvZtPpLX7dzY1i8jRlvBUw7ecJrlPZBIxqIvUNDJd9LjW5lssVD1IWVUNigV/hbI6AkkOMCL6pv5r2kr3ADxb3iRdzhrhwsklok7HhQuR3Yh4ZfeOxpWve/ikPIZg= ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1771762364; c=relaxed/simple; bh=Pf6I89f6cPbdjX3fBc8FiEqIS/e1YjHBGlYZ1BLBEhQ=; h=From:To:Cc:Subject:Date:Message-ID:MIME-Version; b=fONcQBhyVcClsc8sXbtXE4Kl0aDspsfvO0QGwL7GkCMVhQBI80ZMFa3ztMe6C4Mcm/jnzpi3k/9c/6d+dQNnQL3JykHYDKbM6lSMcm7W6zaafme+drC347jKh9/kbNyNUQKy+4wuXJMXtNj8kR2us+l2fcWbxGc9BesLAjc5MSs= ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com; spf=pass smtp.mailfrom=163.com; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b=jgCSLswx; arc=none smtp.client-ip=117.135.210.5 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=none dis=none) header.from=163.com Authentication-Results: smtp.subspace.kernel.org; spf=pass smtp.mailfrom=163.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=163.com header.i=@163.com header.b="jgCSLswx" DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=163.com; s=s110527; h=From:To:Subject:Date:Message-ID:MIME-Version; bh=c3 DKEpM42kgM+H58RJjiuEVNEUo2sdHat9nGtOG33nE=; b=jgCSLswx5BSt3c1PbZ c+2YkHbK7FZEd7HrgwViGOY/I/qztVpJDE9dcy58Nc4aolslxca3amEogLf+9iHG vhze8xjYFFVy+6wXa9ZlAaqvVp+FRdsSM6hoebdVskoubL0YIq247U5fiqMvM6x3 aQQKncIK7h1wWVp/yIb7Dwge8= Received: from haiyue-pc.localdomain (unknown []) by gzga-smtp-mtada-g0-3 (Coremail) with SMTP id _____wBHcrVj8pppBIVMNQ--.28356S2; Sun, 22 Feb 2026 20:11:16 +0800 (CST) From: Haiyue Wang To: linux-kernel@vger.kernel.org, Kees Cook Cc: Haiyue Wang , Lasse Collin , Andrew Morton Subject: [PATCH v1] xz: fix arm fdt compile error for kmalloc replacement Date: Sun, 22 Feb 2026 20:11:00 +0800 Message-ID: <20260222121107.116775-1-haiyuewa@163.com> X-Mailer: git-send-email 2.53.0 Precedence: bulk X-Mailing-List: linux-kernel@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-CM-TRANSID: _____wBHcrVj8pppBIVMNQ--.28356S2 X-Coremail-Antispam: 1Uf129KBjvJXoWxZF13Ary8XF43Gr4fKF4fGrg_yoW5Xw18pa 17C348J34rW3W8Gw4vyr4Fgw13Ja48Jw40ya47t343XFn0qasYgry0yFy5Gw47ZF1Fya4v v3WkZasrJryavw7anT9S1TB71UUUUU7qnTZGkaVYY2UrUUUUjbIjqfuFe4nvWSU5nxnvy2 9KBjDUYxBIdaVFxhVjvjDU0xZFpf9x0pi0tCrUUUUU= X-CM-SenderInfo: 5kdl53xhzdqiywtou0bp/xtbC8AXWQmma8mUdbQAA31 Content-Type: text/plain; charset="utf-8" Align to the commit bf4afc53b77a ("Convert 'alloc_obj' family to use the ne= w default GFP_KERNEL argument") update the 'kmalloc_obj' declaration for userspace to fix below comiple err= or: In file included from arch/arm/boot/compressed/../../../../lib/decompress_u= nxz.c:241, from arch/arm/boot/compressed/decompress.c:56: arch/arm/boot/compressed/../../../../lib/xz/xz_dec_stream.c: In function 'x= z_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'? [-W= implicit-function-declaration] 787 | struct xz_dec *s =3D kmalloc_obj(*s); | ^~~~~~~~~~~ | kmalloc arch/arm/boot/compressed/../../../../lib/xz/xz_dec_stream.c:787:28: error: = initialization of 'struct xz_dec *' from 'int' makes pointer from integer w= ithout a cast [-Wint-conversion] arch/arm/boot/compressed/../../../../lib/decompress_unxz.c:242: arch/arm/boot/compressed/../../../../lib/xz/xz_dec_lzma2.c: In function 'xz= _dec_lzma2_create': arch/arm/boot/compressed/../../../../lib/xz/xz_dec_lzma2.c:1141:34: error: = initialization of 'struct xz_dec_lzma2 *' from 'int' makes pointer from int= eger without a cast [-Wint-conversion] 1141 | struct xz_dec_lzma2 *s =3D kmalloc_obj(*s); | ^~~~~~~~~~~ arch/arm/boot/compressed/../../../../lib/decompress_unxz.c:243: arch/arm/boot/compressed/../../../../lib/xz/xz_dec_bcj.c: In function 'xz_d= ec_bcj_create': arch/arm/boot/compressed/../../../../lib/xz/xz_dec_bcj.c:594:32: error: ini= tialization of 'struct xz_dec_bcj *' from 'int' makes pointer from integer = without a cast [-Wint-conversion] 594 | struct xz_dec_bcj *s =3D kmalloc_obj(*s); | ^~~~~~~~~~~ CC arch/arm/boot/compressed/fdt.o Fixes: 69050f8d6d07 ("treewide: Replace kmalloc with kmalloc_obj for non-sc= alar types") Signed-off-by: Haiyue Wang Acked-by: Lasse Collin Reviewed-by: Kees Cook --- lib/decompress_unxz.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/decompress_unxz.c b/lib/decompress_unxz.c index 32138bb8ef77..05d5cb490a44 100644 --- a/lib/decompress_unxz.c +++ b/lib/decompress_unxz.c @@ -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 !=3D NULL) free(ptr); } while (0) --=20 2.53.0