summaryrefslogtreecommitdiffstats
path: root/drivers/net/wireless/realtek/rtlwifi/rtl8192c
diff options
context:
space:
mode:
authorPing-Ke Shih <pkshih@realtek.com>2019-03-12 17:06:48 +0800
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2019-05-31 06:47:30 -0700
commit09ef780d7d18cd65c00efe558e1904de41cc6738 (patch)
tree9e22fecb7ee5948ef356f4eda9571b389157c687 /drivers/net/wireless/realtek/rtlwifi/rtl8192c
parentae087a4a56a64de9a07b042388cffc6be021c583 (diff)
downloadlinux-stable-09ef780d7d18cd65c00efe558e1904de41cc6738.tar.gz
linux-stable-09ef780d7d18cd65c00efe558e1904de41cc6738.tar.bz2
linux-stable-09ef780d7d18cd65c00efe558e1904de41cc6738.zip
rtlwifi: fix potential NULL pointer dereference
[ Upstream commit 60209d482b97743915883d293c8b85226d230c19 ] In case dev_alloc_skb fails, the fix safely returns to avoid potential NULL pointer dereference. Signed-off-by: Ping-Ke Shih <pkshih@realtek.com> Signed-off-by: Kalle Valo <kvalo@codeaurora.org> Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'drivers/net/wireless/realtek/rtlwifi/rtl8192c')
-rw-r--r--drivers/net/wireless/realtek/rtlwifi/rtl8192c/fw_common.c2
1 files changed, 2 insertions, 0 deletions
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8192c/fw_common.c b/drivers/net/wireless/realtek/rtlwifi/rtl8192c/fw_common.c
index 015476e3f7e5..b7c1d7cc4f45 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8192c/fw_common.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8192c/fw_common.c
@@ -647,6 +647,8 @@ void rtl92c_set_fw_rsvdpagepkt(struct ieee80211_hw *hw,
skb = dev_alloc_skb(totalpacketlen);
+ if (!skb)
+ return;
skb_put_data(skb, &reserved_page_packet, totalpacketlen);
if (cmd_send_packet)