summaryrefslogtreecommitdiff
path: root/drivers/net/wireless/realtek/rtlwifi/rtl8821ae
diff options
context:
space:
mode:
authorPing-Ke Shih <pkshih@realtek.com>2019-03-12 12:06:48 +0300
committerKalle Valo <kvalo@codeaurora.org>2019-04-04 13:25:27 +0300
commit60209d482b97743915883d293c8b85226d230c19 (patch)
tree4dfd3f45af50e21049bf6544bd45b578221e06b2 /drivers/net/wireless/realtek/rtlwifi/rtl8821ae
parent765976285a8c8db3f0eb7f033829a899d0c2786e (diff)
downloadlinux-60209d482b97743915883d293c8b85226d230c19.tar.xz
rtlwifi: fix potential NULL pointer dereference
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>
Diffstat (limited to 'drivers/net/wireless/realtek/rtlwifi/rtl8821ae')
-rw-r--r--drivers/net/wireless/realtek/rtlwifi/rtl8821ae/fw.c4
1 files changed, 4 insertions, 0 deletions
diff --git a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/fw.c b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/fw.c
index dc0eb692088f..fe32d397d287 100644
--- a/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/fw.c
+++ b/drivers/net/wireless/realtek/rtlwifi/rtl8821ae/fw.c
@@ -1623,6 +1623,8 @@ out:
&reserved_page_packet_8812[0], totalpacketlen);
skb = dev_alloc_skb(totalpacketlen);
+ if (!skb)
+ return;
skb_put_data(skb, &reserved_page_packet_8812, totalpacketlen);
rtstatus = rtl_cmd_send_packet(hw, skb);
@@ -1759,6 +1761,8 @@ out:
&reserved_page_packet_8821[0], totalpacketlen);
skb = dev_alloc_skb(totalpacketlen);
+ if (!skb)
+ return;
skb_put_data(skb, &reserved_page_packet_8821, totalpacketlen);
rtstatus = rtl_cmd_send_packet(hw, skb);