]> git.hungrycats.org Git - linux/commitdiff
wifi: nl80211: fix UHR capability validation
authorJohannes Berg <johannes.berg@intel.com>
Tue, 3 Mar 2026 14:16:15 +0000 (15:16 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 14 Sep 2026 11:36:17 +0000 (13:36 +0200)
[ Upstream commit a140826caa2c14aa5a9a6990e514c5edbdb7eafd ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/wireless/nl80211.c

index 9c713094f0a5ccc0457394081ba8684181ae4a3d..232218818ed7f3d1ddf57c17ceef64cc1be54375 100644 (file)
@@ -372,7 +372,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;
 }
 
 static int validate_uhr_operation(const struct nlattr *attr,