wifi: ath11k: fix SAC bug on peer addition with sta band migration
authorChristian Marangi <ansuelsmth@gmail.com>
Thu, 9 Feb 2023 22:26:22 +0000 (23:26 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 11 May 2023 14:03:17 +0000 (23:03 +0900)
commit9354826c02e04e2ae4cdc4cb567baa67a9c2e11d
tree6fa55c7453175d540d9d8887d24ec3641badbec1
parent76f9b0d6f01d8efb8dd2b2491b7d435686dc1461
wifi: ath11k: fix SAC bug on peer addition with sta band migration

[ Upstream commit 60b7d62ba8cdbd073997bff0f1cdae8d844002c0 ]

Fix sleep in atomic context warning detected by Smatch static checker
analyzer.

Following the locking pattern for peer_rhash_add lock tbl_mtx_lock mutex
always even if sta is not transitioning to another band.
This is peer_add function and a more secure locking should not cause
performance regression.

Tested-on: IPQ8074 hw2.0 AHB WLAN.HK.2.5.0.1-01208-QCAHKSWPL_SILICONZ-1

Fixes: d673cb6fe6c0 ("wifi: ath11k: fix peer addition/deletion error on sta band migration")
Reported-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Christian Marangi <ansuelsmth@gmail.com>
Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
Link: https://lore.kernel.org/r/20230209222622.1751-1-ansuelsmth@gmail.com
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/wireless/ath/ath11k/peer.c