]> git.ipfire.org Git - thirdparty/hostap.git/commitdiff
Make eht_cap != NULL check explicit to help static analyzers
authorJouni Malinen <j@w1.fi>
Sun, 23 Feb 2025 10:03:40 +0000 (12:03 +0200)
committerJouni Malinen <j@w1.fi>
Sun, 23 Feb 2025 10:03:40 +0000 (12:03 +0200)
data->eht_enabled was used to avoid getting here with eht_cap == NULL,
but that was too complex for some static analyzers. Make this more
explicit to avoid false reports.

Signed-off-by: Jouni Malinen <j@w1.fi>
src/common/hw_features_common.c

index 78a68aa87daef8b2a4acf185f49f3b03fd2715ca..d9276b93541efaeb17ff8fae4ca3e6abfe005c3e 100644 (file)
@@ -594,7 +594,8 @@ int hostapd_set_freq_params(struct hostapd_freq_params *data,
 
        if (data->eht_enabled) switch (oper_chwidth) {
        case CONF_OPER_CHWIDTH_320MHZ:
-               if (!(eht_cap->phy_cap[EHT_PHYCAP_320MHZ_IN_6GHZ_SUPPORT_IDX] &
+               if (eht_cap &&
+                   !(eht_cap->phy_cap[EHT_PHYCAP_320MHZ_IN_6GHZ_SUPPORT_IDX] &
                      EHT_PHYCAP_320MHZ_IN_6GHZ_SUPPORT_MASK)) {
                        wpa_printf(MSG_ERROR,
                                   "320 MHz channel width is not supported in 5 or 6 GHz");