ath11k: fix a locking bug in ath11k_mac_op_start()
authorDan Carpenter <dan.carpenter@oracle.com>
Tue, 9 Feb 2021 07:29:43 +0000 (09:29 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 4 Mar 2021 10:37:28 +0000 (11:37 +0100)
commit1a6c71880fadb69359668b493c02ae23538fdb45
treebfbc6a44d516a72bf938b9af78f7440163cfaf79
parentc2fd1a9715a1cceba06f7f6d83915274d0485113
ath11k: fix a locking bug in ath11k_mac_op_start()

[ Upstream commit c202e2ebe1dc454ad54fd0018c023ec553d47284 ]

This error path leads to a Smatch warning:

drivers/net/wireless/ath/ath11k/mac.c:4269 ath11k_mac_op_start()
error: double unlocked '&ar->conf_mutex' (orig line 4251)

We're not holding the lock when we do the "goto err;" so it leads to a
double unlock.  The fix is to hold the lock for a little longer.

Fixes: c83c500b55b6 ("ath11k: enable idle power save mode")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
[kvalo@codeaurora.org: move also rcu_assign_pointer() call]
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Link: https://lore.kernel.org/r/YBk4GoeE+yc0wlJH@mwanda
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/wireless/ath/ath11k/mac.c