[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <BYAPR11MB3367038BA3776DF1C17D1B97FCFA9@BYAPR11MB3367.namprd11.prod.outlook.com>
Date: Thu, 5 Jan 2023 05:52:13 +0000
From: "G, GurucharanX" <gurucharanx.g@...el.com>
To: Jiasheng Jiang <jiasheng@...as.ac.cn>,
"jiri@...nulli.us" <jiri@...nulli.us>
CC: "leon@...nel.org" <leon@...nel.org>,
"intel-wired-lan@...ts.osuosl.org" <intel-wired-lan@...ts.osuosl.org>,
"Brandeburg, Jesse" <jesse.brandeburg@...el.com>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"edumazet@...gle.com" <edumazet@...gle.com>,
"Nguyen, Anthony L" <anthony.l.nguyen@...el.com>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"kuba@...nel.org" <kuba@...nel.org>,
"pabeni@...hat.com" <pabeni@...hat.com>,
"davem@...emloft.net" <davem@...emloft.net>
Subject: RE: [Intel-wired-lan] [PATCH net v4] ice: Add check for kzalloc
> -----Original Message-----
> From: Intel-wired-lan <intel-wired-lan-bounces@...osl.org> On Behalf Of
> Jiasheng Jiang
> Sent: Thursday, December 8, 2022 7:06 PM
> To: jiri@...nulli.us
> Cc: leon@...nel.org; intel-wired-lan@...ts.osuosl.org; Jiasheng Jiang
> <jiasheng@...as.ac.cn>; Brandeburg, Jesse <jesse.brandeburg@...el.com>;
> linux-kernel@...r.kernel.org; edumazet@...gle.com; Nguyen, Anthony L
> <anthony.l.nguyen@...el.com>; netdev@...r.kernel.org; kuba@...nel.org;
> pabeni@...hat.com; davem@...emloft.net
> Subject: [Intel-wired-lan] [PATCH net v4] ice: Add check for kzalloc
>
> Add the check for the return value of kzalloc in order to avoid NULL pointer
> dereference.
> Moreover, use the goto-label to share the clean code.
>
> Fixes: d6b98c8d242a ("ice: add write functionality for GNSS TTY")
> Signed-off-by: Jiasheng Jiang <jiasheng@...as.ac.cn>
> ---
> Changelog:
>
> v3 -> v4:
>
> 1. Move the check right after the kzalloc.
>
> v2 -> v3:
>
> 1. Use "while (i--)" to simplify the code.
>
> v1 -> v2:
>
> 1. Use goto-label to share the clean code.
> ---
> drivers/net/ethernet/intel/ice/ice_gnss.c | 23 ++++++++++++++---------
> 1 file changed, 14 insertions(+), 9 deletions(-)
>
Tested-by: Gurucharan G <gurucharanx.g@...el.com> (A Contingent worker at Intel)
Powered by blists - more mailing lists