Files
linux-stable-mirror/net/wireless
Kees Cook 24bf1d10a0 wifi: nl80211: Set num_sub_specs before looping through sub_specs
[ Upstream commit 2ed9a9fc99 ]

The processing of the struct cfg80211_sar_specs::sub_specs flexible
array requires its counter, num_sub_specs, to be assigned before the
loop in nl80211_set_sar_specs(). Leave the final assignment after the
loop in place in case fewer ended up in the array.

Fixes: aa4ec06c45 ("wifi: cfg80211: use __counted_by where appropriate")
Signed-off-by: Kees Cook <kees@kernel.org>
Reviewed-by: Gustavo A. R. Silva <gustavoars@kernel.org>
Link: https://patch.msgid.link/20250721183125.work.183-kees@kernel.org
Signed-off-by: Johannes Berg <johannes.berg@intel.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-08-15 12:13:46 +02:00
..
2024-09-06 13:01:05 +02:00
2024-09-06 13:01:05 +02:00