]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
wifi: nl80211: fix UHR capability validation
authorJohannes Berg <johannes.berg@intel.com>
Tue, 3 Mar 2026 14:16:15 +0000 (15:16 +0100)
committerJohannes Berg <johannes.berg@intel.com>
Fri, 6 Mar 2026 09:45:24 +0000 (10:45 +0100)
The ieee80211_uhr_capa_size_ok() function returns a boolean,
but we need an error code here. Fix that.

Fixes: 072e6f7f416f ("wifi: cfg80211: add initial UHR support")
Cc: <stable+noautosel@kernel.org> # no drivers with UHR yet
Link: https://patch.msgid.link/20260303151614.e87ea9995be5.Ie164040a51855a3e548f05f0d0291d7d7993c7ee@changeid
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
net/wireless/nl80211.c

index 2225f5d0b124d4ae8bd2da637ae9d9c7b747325e..699687a0caa9f665d150b4e56fd3987c43911326 100644 (file)
@@ -339,7 +339,9 @@ static int validate_uhr_capa(const struct nlattr *attr,
        const u8 *data = nla_data(attr);
        unsigned int len = nla_len(attr);
 
-       return ieee80211_uhr_capa_size_ok(data, len, false);
+       if (!ieee80211_uhr_capa_size_ok(data, len, false))
+               return -EINVAL;
+       return 0;
 }
 
 /* policy for the attributes */