[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <1552381414.27421.2.camel@realtek.com>
Date: Tue, 12 Mar 2019 09:03:41 +0000
From: Pkshih <pkshih@...ltek.com>
To: "kjlu@....edu" <kjlu@....edu>
CC: "mingo@...nel.org" <mingo@...nel.org>,
"Larry.Finger@...inger.net" <Larry.Finger@...inger.net>,
"rdunlap@...radead.org" <rdunlap@...radead.org>,
"pakki001@....edu" <pakki001@....edu>,
"linux-kernel@...r.kernel.org" <linux-kernel@...r.kernel.org>,
"akpm@...ux-foundation.org" <akpm@...ux-foundation.org>,
"kvalo@...eaurora.org" <kvalo@...eaurora.org>,
"netdev@...r.kernel.org" <netdev@...r.kernel.org>,
"davem@...emloft.net" <davem@...emloft.net>,
"linux-wireless@...r.kernel.org" <linux-wireless@...r.kernel.org>
Subject: Re: [PATCH] net: rtl8192c: fix a potential NULL pointer dereference
On Tue, 2019-03-12 at 02:59 -0500, Kangjie Lu wrote:
> In case dev_alloc_skb fails, the fix safely returns to avoid
> potential NULL pointer dereference.
>
> Signed-off-by: Kangjie Lu <kjlu@....edu>
> ---
> drivers/net/wireless/realtek/rtlwifi/rtl8192c/fw_common.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192c/fw_common.c
> b/drivers/net/wireless/realtek/rtlwifi/rtl8192c/fw_common.c
> index 18c76990a089..9042fc044c7e 100644
> --- a/drivers/net/wireless/realtek/rtlwifi/rtl8192c/fw_common.c
> +++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192c/fw_common.c
> @@ -623,6 +623,9 @@ void rtl92c_set_fw_rsvdpagepkt(struct ieee80211_hw *hw,
> u1rsvdpageloc, 3);
>
> skb = dev_alloc_skb(totalpacketlen);
> + if (!skb)
> + return;
> +
> skb_put_data(skb, &reserved_page_packet, totalpacketlen);
>
> if (cmd_send_packet)
The subject prefix should be 'rtlwifi: ...'.
Your fix is ok, but I would like to fix all failed cases of dev_alloc_skb().
I will send another patch to fix all of them.
Thanks
PK
Powered by blists - more mailing lists