Files
build/patch/kernel/archive/sunxi-5.17/patches.megous/rtw88-check-for-validity-before-using-a-pointer.patch
The-going 0f7200c793 Sunxi 5.17 (#3613)
* The initial state of a series of patches for sunxi-5.17

tag orange-pi-5.17-20220323-1423

* DEBUG for sunxi-5.17

* Add Armbian patches to 5.17

* Fix duplicate nodes for sun50i-h5-orangepi-pc2

* Fix reg_ahci_5v to status okay for bananapro board

* Remove an unused patch for an unsupported sun50i-h6-tanix-tx6 board
2022-03-31 20:32:04 +03:00

46 lines
1.5 KiB
Diff

From e2f25929ca0609f36708cafd15ecea497b886616 Mon Sep 17 00:00:00 2001
From: Muhammad Usama Anjum <usama.anjum@collabora.com>
Date: Fri, 21 Jan 2022 15:08:11 +0800
Subject: [PATCH 430/456] rtw88: check for validity before using a pointer
ieee80211_probereq_get() can return NULL. Pointer skb should be checked
for validty before use. If it is not valid, list of skbs needs to be
freed.
Fixes: 10d162b2ed39 ("rtw88: 8822c: add ieee80211_ops::hw_scan")
Signed-off-by: Muhammad Usama Anjum <usama.anjum@collabora.com>
Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Signed-off-by: Kalle Valo <kvalo@kernel.org>
Link: https://lore.kernel.org/r/20220121070813.9656-2-pkshih@realtek.com
---
drivers/net/wireless/realtek/rtw88/fw.c | 8 ++++++++
1 file changed, 8 insertions(+)
diff --git a/drivers/net/wireless/realtek/rtw88/fw.c b/drivers/net/wireless/realtek/rtw88/fw.c
index 2f7c036f9022..b56dc43229d2 100644
--- a/drivers/net/wireless/realtek/rtw88/fw.c
+++ b/drivers/net/wireless/realtek/rtw88/fw.c
@@ -1866,11 +1866,19 @@ static int rtw_hw_scan_update_probe_req(struct rtw_dev *rtwdev,
req->ssids[i].ssid,
req->ssids[i].ssid_len,
req->ie_len);
+ if (!skb)
+ goto out;
rtw_append_probe_req_ie(rtwdev, skb, &list, rtwvif);
kfree_skb(skb);
}
return _rtw_hw_scan_update_probe_req(rtwdev, num, &list);
+
+out:
+ skb_queue_walk(&list, skb)
+ kfree_skb(skb);
+
+ return -ENOMEM;
}
static int rtw_add_chan_info(struct rtw_dev *rtwdev, struct rtw_chan_info *info,
--
2.34.1