wifi: nl80211: fix UHR capability validation

The ieee80211_uhr_capa_size_ok() function returns a boolean,
but we need an error code here. Fix that.

Fixes: 072e6f7f41 ("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>
This commit is contained in:
Johannes Berg
2026-03-03 15:16:15 +01:00
parent 9f39e2cc2b
commit a140826caa

View 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 */