mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Ian Rogers <irogers@google.com>
To: Johannes Berg <johannes@sipsolutions.net>
Cc: linux-wireless@vger.kernel.org, linux-kernel@vger.kernel.org,
	 llvm@lists.linux.dev, Elkin Cruz <elkin@google.com>,
	Ian Rogers <irogers@google.com>
Subject: [PATCH 2/2] wifi: mac80211: Return NEG_TTLM_RES_REJECT when sdata is not in driver
Date: Thu, 19 Nov 2026 09:09:11 -0800	[thread overview]
Message-ID: <ae02ab481b5ce8259a22135255de5864777e37d9.1795106967.git.irogers@google.com> (raw)
In-Reply-To: <cover.1795106967.git.irogers@google.com>

drv_can_neg_ttlm() returns enum ieee80211_neg_ttlm_res and initializes
res to NEG_TTLM_RES_REJECT, but returns -EIO if
!check_sdata_in_driver(sdata).

In ieee80211_process_neg_ttlm_req(), any return value other than
NEG_TTLM_RES_ACCEPT is passed to ieee80211_send_neg_ttlm_res(), where
an out-of-range -EIO value hits 'default: WARN_ON(1); return;'.

Return NEG_TTLM_RES_REJECT instead of -EIO when sdata is not in the
driver.

Found via Clang -Wimplicit-int-enum-cast on an x86_64 allyesconfig
build. Verified by building net/mac80211/mlme.o with LLVM=1 W=1
(-Werror) and -Wimplicit-int-enum-cast; not runtime-tested on MLO
hardware.

Fixes: 8f500fbc6c65 ("wifi: mac80211: process and save negotiated TID to Link mapping request")
Signed-off-by: Ian Rogers <irogers@google.com>
---
 net/mac80211/driver-ops.h | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/mac80211/driver-ops.h b/net/mac80211/driver-ops.h
index 9aefa55cbdfd..0558ba58f3fc 100644
--- a/net/mac80211/driver-ops.h
+++ b/net/mac80211/driver-ops.h
@@ -1740,7 +1740,7 @@ drv_can_neg_ttlm(struct ieee80211_local *local,
 
 	might_sleep();
 	if (!check_sdata_in_driver(sdata))
-		return -EIO;
+		return NEG_TTLM_RES_REJECT;
 
 	trace_drv_can_neg_ttlm(local, sdata, neg_ttlm);
 	if (local->ops->can_neg_ttlm)
-- 
2.56.1.708.g77570a6a1d-goog


      parent reply	other threads:[~2026-11-19 17:09 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-11-19 17:09 [PATCH 0/2] wifi: mac80211: Two return-value fixes from Clang warning audit Ian Rogers
2026-11-19 17:09 ` [PATCH 1/2] wifi: mac80211: Return 0 from ieee80211_reconfig_nan_offload_de() Ian Rogers
2026-11-19 17:09 ` Ian Rogers [this message]

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=ae02ab481b5ce8259a22135255de5864777e37d9.1795106967.git.irogers@google.com \
    --to=irogers@google.com \
    --cc=elkin@google.com \
    --cc=johannes@sipsolutions.net \
    --cc=linux-kernel@vger.kernel.org \
    --cc=linux-wireless@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox

all inboxes | Powered by JetHome®