mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/
synced 2026-11-13 07:31:07 +00:00
wifi: cfg80211: fix NAN local schedule update ordering and allocation
In cfg80211_nan_set_local_schedule(), after calling the driver, the old channel definitions were freed and only then the new ones were allocated and stored. This had two problems: - On allocation failure the previous channel definitions had already been freed while the driver had already applied the new schedule, leaving the wdev with no channel definitions. - If the driver completes a deferred schedule update synchronously, the completion notification to user space fired before the new channel definitions were stored, exposing an inconsistent state. Allocate and fill the new channel definitions before calling the driver, swap them in, and roll back on failure. Also set the pending flag before the driver call so that a synchronous deferred completion can clear it. Signed-off-by: Andrei Otcheretianski <andrei.otcheretianski@intel.com> Signed-off-by: Miri Korenblit <miriam.rachel.korenblit@intel.com> Link: https://patch.msgid.link/20260922132247.d0665fa8a5c1.I0b45103342d4a911142a2325b9259258758a0670@changeid Signed-off-by: Johannes Berg <johannes.berg@intel.com>
This commit is contained in:
parent
6571b6a24c
commit
e6c32e485f
1 changed files with 34 additions and 18 deletions
Loading…
Add table
Add a link
Reference in a new issue