wifi: iwlegacy: replace BUG_ON() with WARN_ON() on num_stations check
authorStanislaw Gruszka <stf_xl@wp.pl>
Fri, 24 Jul 2026 09:55:45 +0000 (11:55 +0200)
committerJohannes Berg <johannes.berg@intel.com>
Tue, 28 Jul 2026 13:35:37 +0000 (15:35 +0200)
commit57aa1718d5953dd532137d43b696c68545c2e0b3
tree4ee31a2925b178ee11a08fa7b75e93d517908585
parent0502d5077e419427d80f4d46ba95d0067f5fb916
wifi: iwlegacy: replace BUG_ON() with WARN_ON() on num_stations check

BUG_ON() for il->num_stations < 0 can happen in real word, see
https://bugzilla.kernel.org/show_bug.cgi?id=221733

Replace BUG_ON() with WARN_ON() (and reset the counter to 0) to
do not put whole system to inconsistent state on the condition.

Also allocate debugfs buffer for all stations (32 or 25)
to do not use num_stations since it might not be right.

Signed-off-by: Stanislaw Gruszka <stf_xl@wp.pl>
Link: https://patch.msgid.link/20260724095545.33647-1-stf_xl@wp.pl
[clarify commit message wrt. debugfs buffer]
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
drivers/net/wireless/intel/iwlegacy/common.c
drivers/net/wireless/intel/iwlegacy/debug.c