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 43195C63797 for ; Tue, 17 Jan 2023 10:24:05 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S236298AbjAQKYD (ORCPT ); Tue, 17 Jan 2023 05:24:03 -0500 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:34190 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S235285AbjAQKYB (ORCPT ); Tue, 17 Jan 2023 05:24:01 -0500 Received: from mxct.zte.com.cn (mxct.zte.com.cn [183.62.165.209]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 81CA926593; Tue, 17 Jan 2023 02:23:58 -0800 (PST) Received: from mse-fl1.zte.com.cn (unknown [10.5.228.132]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mxct.zte.com.cn (FangMail) with ESMTPS id 4Nx4k46yL0z4xq20; Tue, 17 Jan 2023 18:23:56 +0800 (CST) Received: from xaxapp01.zte.com.cn ([10.88.99.176]) by mse-fl1.zte.com.cn with SMTP id 30HANicF048677; Tue, 17 Jan 2023 18:23:44 +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:23:47 +0800 (CST) Date: Tue, 17 Jan 2023 18:23:47 +0800 (CST) X-Zmail-TransId: 2af963c67733ffffffffed689a60 X-Mailer: Zmail v1.0 Message-ID: <202301171823476416320@zte.com.cn> Mime-Version: 1.0 From: To: Cc: , , , , Subject: =?UTF-8?B?W1BBVENIXSBhbHBoYTogcG90ZW50aWFsIGRlcmVmZXJlbmNlIG9mIG51bGwgcG9pbnRlcg==?= X-MAIL: mse-fl1.zte.com.cn 30HANicF048677 X-Fangmail-Gw-Spam-Type: 0 X-Fangmail-Anti-Spam-Filtered: true X-Fangmail-MID-QID: 63C6773C.000/4Nx4k46yL0z4xq20 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 kmalloc() 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/alpha/kernel/module.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/arch/alpha/kernel/module.c b/arch/alpha/kernel/module.c index 5b60c248de9e..5442b75a98c2 100644 --- a/arch/alpha/kernel/module.c +++ b/arch/alpha/kernel/module.c @@ -47,6 +47,8 @@ process_reloc_for_got(Elf64_Rela *rela, } g =3D kmalloc (sizeof (*g), GFP_KERNEL); + if (!g) + return; g->next =3D chains[r_sym].next; g->r_addend =3D r_addend; g->got_offset =3D *poffset; --=20 2.25.1