mirror of https://lore.kernel.org/ath12k/
 help / color / mirror / Atom feed
* [PATCH] wifi: ath12k: fix freq range overflow when reg rules not yet parsed
@ 2026-09-03 13:29 Michael Pfeifroth
  0 siblings, 0 replies; only message in thread
From: Michael Pfeifroth @ 2026-09-03 13:29 UTC (permalink / raw)
  To: Jeff Johnson; +Cc: linux-wireless, ath12k, linux-kernel, stable

ath12k_regd_update() resets ab->reg_freq_{2,5,6}ghz.start_freq to INT_MAX
before the per-band regulatory rules are parsed, and firmware delivers the
2 GHz rules before the 5/6 GHz ones. If it runs for a radio whose rules are
not applied yet, freq_low stays at INT_MAX, and MHZ_TO_KHZ(freq_low)
overflows u32 into an inverted, empty range. cfg80211 then rejects AP
bring-up on that band with "Failed to set beacon parameters".

Reject non-positive-width ranges; a later ath12k_regd_update() installs the
correct range once the rules exist.

Fixes: 0d777aa2ca77 ("wifi: ath12k: fix mac pdev frequency range update")
Cc: stable@vger.kernel.org
Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.6-01243-QCAHKSWPL_SILICONZ-1
Signed-off-by: Michael Pfeifroth <micpf@westermo.com>
---
 drivers/net/wireless/ath/ath12k/mac.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c
index 99bf5cf79..654c58d7c 100644
--- a/drivers/net/wireless/ath/ath12k/mac.c
+++ b/drivers/net/wireless/ath/ath12k/mac.c
@@ -14125,7 +14125,7 @@ EXPORT_SYMBOL(ath12k_mac_op_set_rekey_data);
 void ath12k_mac_update_freq_range(struct ath12k *ar,
 				  u32 freq_low, u32 freq_high)
 {
-	if (!(freq_low && freq_high))
+	if (!freq_low || freq_low >= freq_high)
 		return;
 
 	if (ar->freq_range.start_freq || ar->freq_range.end_freq) {

base-commit: 1b78070aaef63512688aebfbc82365ef9d6660f1
-- 
2.34.1



^ permalink raw reply related	[flat|nested] only message in thread

only message in thread, other threads:[~2026-09-03 13:29 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-03 13:29 [PATCH] wifi: ath12k: fix freq range overflow when reg rules not yet parsed Michael Pfeifroth

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox