mac80211: remove unnecessary NULL check in ieee80211_register_hw()
authorDan Carpenter <dan.carpenter@oracle.com>
Mon, 28 Jun 2021 10:10:38 +0000 (13:10 +0300)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 13 Aug 2021 07:51:03 +0000 (09:51 +0200)
The address "&sband->iftype_data[i]" points to an array at the end of
struct.  It can't be NULL and so the check can be removed.

Fixes: bac2fd3d7534 ("mac80211: remove use of ieee80211_get_he_sta_cap()")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Link: https://lore.kernel.org/r/YNmgHi7Rh3SISdog@mwanda
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/mac80211/main.c

index 05f4c3c72619f7647f3c3e1465b652bac3108403..ac0653b58f5fa48352f7165867bad5c7f1dd1816 100644 (file)
@@ -1018,7 +1018,7 @@ int ieee80211_register_hw(struct ieee80211_hw *hw)
 
                        iftd = &sband->iftype_data[i];
 
-                       supp_he = supp_he || (iftd && iftd->he_cap.has_he);
+                       supp_he = supp_he || iftd->he_cap.has_he;
                }
 
                /* HT, VHT, HE require QoS, thus >= 4 queues */