ieee80211_probereq_get() can return NULL. Pointer skb should be checked for validty before use. Fixes: 10d162b2ed39 ("rtw88: 8822c: add ieee80211_ops::hw_scan") Signed-off-by: Muhammad Usama Anjum <usama.anjum@xxxxxxxxxxxxx> --- drivers/net/wireless/realtek/rtw88/fw.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/net/wireless/realtek/rtw88/fw.c b/drivers/net/wireless/realtek/rtw88/fw.c index 2f7c036f9022..0fc05a810d05 100644 --- a/drivers/net/wireless/realtek/rtw88/fw.c +++ b/drivers/net/wireless/realtek/rtw88/fw.c @@ -1866,6 +1866,8 @@ 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) + return -ENOMEM; rtw_append_probe_req_ie(rtwdev, skb, &list, rtwvif); kfree_skb(skb); } -- 2.30.2