Commit 3a016862 authored by Kees Cook's avatar Kees Cook Committed by Johannes Berg
Browse files

wifi: cfg80211: Move cfg80211_scan_req_add_chan() n_channels increment earlier



Since adding __counted_by(n_channels) to struct cfg80211_scan_request,
anything adding to the channels array must increment n_channels first.
Move n_channels increment earlier.

Reported-by: default avatarJohn Rowley <lkml@johnrowley.me>
Closes: https://lore.kernel.org/stable/1815535c709ba9d9.156c6a5c9cdf6e59.b249b6b6a5ee4634@localhost.localdomain/


Fixes: aa4ec06c ("wifi: cfg80211: use __counted_by where appropriate")
Signed-off-by: default avatarKees Cook <kees@kernel.org>
Reviewed-by: default avatarGustavo A. R. Silva <gustavoars@kernel.org>
Link: https://patch.msgid.link/20241230183610.work.680-kees@kernel.org


Signed-off-by: default avatarJohannes Berg <johannes.berg@intel.com>
parent 7553477c
Loading
Loading
Loading
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please to comment