From a140826caa2c14aa5a9a6990e514c5edbdb7eafd Mon Sep 17 00:00:00 2001 From: Johannes Berg Date: Tue, 3 Mar 2026 15:16:15 +0100 Subject: [PATCH] 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: 072e6f7f416f ("wifi: cfg80211: add initial UHR support") Cc: # no drivers with UHR yet Link: https://patch.msgid.link/20260303151614.e87ea9995be5.Ie164040a51855a3e548f05f0d0291d7d7993c7ee@changeid Signed-off-by: Johannes Berg --- net/wireless/nl80211.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/net/wireless/nl80211.c b/net/wireless/nl80211.c index 2225f5d0b124d..699687a0caa9f 100644 --- a/net/wireless/nl80211.c +++ b/net/wireless/nl80211.c @@ -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 */ -- 2.47.3