ath9k: Fix a locking bug in ath9k_add_interface()
authorDan Carpenter <dan.carpenter@oracle.com>
Fri, 19 Oct 2018 20:08:43 +0000 (23:08 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 20 Nov 2019 17:46:51 +0000 (18:46 +0100)
commitccc1e600844d085ccfdbedf77db979a2d83c1a7c
tree5ee0ea56db8926ec9a77bbec61de0ce5d3709a71
parente97d09277b7730f85427969115c4ea358bcc2703
ath9k: Fix a locking bug in ath9k_add_interface()

[ Upstream commit 461cf036057477805a8a391e5fd0f5264a5e56a8 ]

We tried to revert commit d9c52fd17cb4 ("ath9k: fix tx99 with monitor
mode interface") but accidentally missed part of the locking change.

The lock has to be held earlier so that we're holding it when we do
"sc->tx99_vif = vif;" and also there in the current code there is a
stray unlock before we have taken the lock.

Fixes: 6df0580be8bc ("ath9k: add back support for using active monitor interfaces for tx99")
Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Kalle Valo <kvalo@codeaurora.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/wireless/ath/ath9k/main.c