forked from Minki/linux
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>
This commit is contained in:
parent
765976285a
commit
60209d482b
@ -600,6 +600,8 @@ void rtl88e_set_fw_rsvdpagepkt(struct ieee80211_hw *hw, bool b_dl_finished)
|
||||
u1rsvdpageloc, 3);
|
||||
|
||||
skb = dev_alloc_skb(totalpacketlen);
|
||||
if (!skb)
|
||||
return;
|
||||
skb_put_data(skb, &reserved_page_packet, totalpacketlen);
|
||||
|
||||
rtstatus = rtl_cmd_send_packet(hw, skb);
|
||||
|
@ -623,6 +623,8 @@ 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)
|
||||
|
@ -744,6 +744,8 @@ void rtl92ee_set_fw_rsvdpagepkt(struct ieee80211_hw *hw, bool b_dl_finished)
|
||||
u1rsvdpageloc, 3);
|
||||
|
||||
skb = dev_alloc_skb(totalpacketlen);
|
||||
if (!skb)
|
||||
return;
|
||||
skb_put_data(skb, &reserved_page_packet, totalpacketlen);
|
||||
|
||||
rtstatus = rtl_cmd_send_packet(hw, skb);
|
||||
|
@ -448,6 +448,8 @@ void rtl8723e_set_fw_rsvdpagepkt(struct ieee80211_hw *hw, bool b_dl_finished)
|
||||
u1rsvdpageloc, 3);
|
||||
|
||||
skb = dev_alloc_skb(totalpacketlen);
|
||||
if (!skb)
|
||||
return;
|
||||
skb_put_data(skb, &reserved_page_packet, totalpacketlen);
|
||||
|
||||
rtstatus = rtl_cmd_send_packet(hw, skb);
|
||||
|
@ -562,6 +562,8 @@ void rtl8723be_set_fw_rsvdpagepkt(struct ieee80211_hw *hw,
|
||||
u1rsvdpageloc, sizeof(u1rsvdpageloc));
|
||||
|
||||
skb = dev_alloc_skb(totalpacketlen);
|
||||
if (!skb)
|
||||
return;
|
||||
skb_put_data(skb, &reserved_page_packet, totalpacketlen);
|
||||
|
||||
rtstatus = rtl_cmd_send_packet(hw, skb);
|
||||
|
@ -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);
|
||||
|
Loading…
Reference in New Issue
Block a user