From nobody Mon Sep 15 00:05:55 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id 2CBE2C3DA78 for ; Tue, 17 Jan 2023 10:22:17 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236566AbjAQKWP (ORCPT ); Tue, 17 Jan 2023 05:22:15 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33534 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S236148AbjAQKWM (ORCPT ); Tue, 17 Jan 2023 05:22:12 -0500 Received: from mxhk.zte.com.cn (mxhk.zte.com.cn [63.216.63.35]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 21E0C26593 for ; Tue, 17 Jan 2023 02:22:11 -0800 (PST) Received: from mse-fl2.zte.com.cn (unknown [10.5.228.133]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mxhk.zte.com.cn (FangMail) with ESMTPS id 4Nx4h023LVz6FK2P; Tue, 17 Jan 2023 18:22:08 +0800 (CST) Received: from xaxapp02.zte.com.cn ([10.88.97.241]) by mse-fl2.zte.com.cn with SMTP id 30HAM1uL018130; Tue, 17 Jan 2023 18:22:01 +0800 (+08) (envelope-from ye.xingchen@zte.com.cn) Received: from mapi (xaxapp01[null]) by mapi (Zmail) with MAPI id mid31; Tue, 17 Jan 2023 18:22:04 +0800 (CST) Date: Tue, 17 Jan 2023 18:22:04 +0800 (CST) X-Zmail-TransId: 2af963c676ccffffffffc36867c3 X-Mailer: Zmail v1.0 Message-ID: <202301171822040406304@zte.com.cn> Mime-Version: 1.0 From: To: Cc: , , , , , Subject: =?UTF-8?B?W1BBVENIXSBBUk06IG12ZWJ1OiBwb3RlbnRpYWwgZGVyZWZlcmVuY2Ugb2YgbnVsbCBwb2ludGVy?= X-MAIL: mse-fl2.zte.com.cn 30HAM1uL018130 X-Fangmail-Gw-Spam-Type: 0 X-FangMail-Miltered: at cgslv5.04-192.168.250.138.novalocal with ID 63C676D0.000 by FangMail milter! X-FangMail-Envelope: 1673950928/4Nx4h023LVz6FK2P/63C676D0.000/10.5.228.133/[10.5.228.133]/mse-fl2.zte.com.cn/ X-Fangmail-Anti-Spam-Filtered: true X-Fangmail-MID-QID: 63C676D0.000/4Nx4h023LVz6FK2P Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="utf-8" From: Minghao Chi The return value of kzalloc() needs to be checked. To avoid use of null pointer in case of the failure of alloc. Reported-by: Zeal Robot Signed-off-by: Minghao Chi Signed-off-by: ye xingchen --- arch/arm/mach-mvebu/board-v7.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/arch/arm/mach-mvebu/board-v7.c b/arch/arm/mach-mvebu/board-v7.c index fd5d0c8ff695..b93b4a8a8357 100644 --- a/arch/arm/mach-mvebu/board-v7.c +++ b/arch/arm/mach-mvebu/board-v7.c @@ -125,7 +125,8 @@ static void __init i2c_quirk(void) struct property *new_compat; new_compat =3D kzalloc(sizeof(*new_compat), GFP_KERNEL); - + if (!new_compat) + return; new_compat->name =3D kstrdup("compatible", GFP_KERNEL); new_compat->length =3D sizeof("marvell,mv78230-a0-i2c"); new_compat->value =3D kstrdup("marvell,mv78230-a0-i2c", --=20 2.25.1