[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <4c393bbd-9d93-6f6e-fc82-133304cfdf69@codeaurora.org>
Date: Wed, 20 Mar 2019 18:42:45 +0530
From: Mukesh Ojha <mojha@...eaurora.org>
To: Aditya Pakki <pakki001@....edu>
Cc: kjlu@....edu, Greg Kroah-Hartman <gregkh@...uxfoundation.org>,
Nathan Chancellor <natechancellor@...il.com>,
devel@...verdev.osuosl.org, linux-kernel@...r.kernel.org
Subject: Re: [PATCH] staging: rtlwifi: Fix potential NULL pointer dereference
On 3/13/2019 9:43 PM, Aditya Pakki wrote:
> phydm.internal is allocated using kzalloc which is used multiple
> times without a check for NULL pointer. This patch avoids such a
> scenario.
>
> Signed-off-by: Aditya Pakki <pakki001@....edu>
> ---
> drivers/staging/rtlwifi/phydm/rtl_phydm.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/staging/rtlwifi/phydm/rtl_phydm.c b/drivers/staging/rtlwifi/phydm/rtl_phydm.c
> index 9930ed954abb..37c7fcb72b65 100644
> --- a/drivers/staging/rtlwifi/phydm/rtl_phydm.c
> +++ b/drivers/staging/rtlwifi/phydm/rtl_phydm.c
> @@ -181,6 +181,9 @@ static int rtl_phydm_init_priv(struct rtl_priv *rtlpriv,
> rtlpriv->phydm.internal =
> kzalloc(sizeof(struct phy_dm_struct), GFP_KERNEL);
>
> + if (!rtlpriv->phydm.internal)
> + return -ENOMEM;
> +
Although, it is good to add a check but nobody is checking this
functions returned value.
Reviewed-by: Mukesh Ojha <mojha@...eaurora.org>
Can you fix that cleanly ? Otherwise i will do.
Cheers,
Mukesh
> _rtl_phydm_init_com_info(rtlpriv, ic, params);
>
> odm_init_all_timers(dm);
Powered by blists - more mailing lists