]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
wifi: cfg80211: Fix interface type validation
authorIlan Peer <ilan.peer@intel.com>
Wed, 9 Jul 2025 20:37:55 +0000 (23:37 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Aug 2025 16:41:08 +0000 (18:41 +0200)
[ Upstream commit 14450be2332a49445106403492a367412b8c23f4 ]

Fix a condition that verified valid values of interface types.

Signed-off-by: Ilan Peer <ilan.peer@intel.com>
Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com>
Link: https://patch.msgid.link/20250709233537.7ad199ca5939.I0ac1ff74798bf59a87a57f2e18f2153c308b119b@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
include/net/cfg80211.h

index 10248d527616aa3536af913173f2efe55869f886..1faeb587988fe99b973e1ac8c1bde363effa1dc7 100644 (file)
@@ -633,7 +633,7 @@ ieee80211_get_sband_iftype_data(const struct ieee80211_supported_band *sband,
        const struct ieee80211_sband_iftype_data *data;
        int i;
 
-       if (WARN_ON(iftype >= NL80211_IFTYPE_MAX))
+       if (WARN_ON(iftype >= NUM_NL80211_IFTYPES))
                return NULL;
 
        if (iftype == NL80211_IFTYPE_AP_VLAN)