]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: rtw89: check return value of ieee80211_probereq_get() for RNR
authorPing-Ke Shih <pkshih@realtek.com>
Thu, 19 Sep 2024 08:12:14 +0000 (16:12 +0800)
committerPing-Ke Shih <pkshih@realtek.com>
Thu, 26 Sep 2024 01:17:59 +0000 (09:17 +0800)
The return value of ieee80211_probereq_get() might be NULL, so check it
before using to avoid NULL pointer access.

Addresses-Coverity-ID: 1529805 ("Dereference null return value")

Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
Link: https://patch.msgid.link/20240919081216.28505-2-pkshih@realtek.com
drivers/net/wireless/realtek/rtw89/fw.c

index 3c4a3302d43d5e09c1a5fe880a026cf62a76e8fd..1be1f61e0858bd354640d565241373a15224f03a 100644 (file)
@@ -6089,6 +6089,9 @@ static int rtw89_update_6ghz_rnr_chan(struct rtw89_dev *rtwdev,
 
                skb = ieee80211_probereq_get(rtwdev->hw, rtwvif_link->mac_addr,
                                             NULL, 0, req->ie_len);
+               if (!skb)
+                       return -ENOMEM;
+
                skb_put_data(skb, ies->ies[NL80211_BAND_6GHZ], ies->len[NL80211_BAND_6GHZ]);
                skb_put_data(skb, ies->common_ies, ies->common_ie_len);
                hdr = (struct ieee80211_hdr *)skb->data;