Skip to content
/ linux Public

Commit aca4c9e

Browse files
bvanasschegregkh
authored andcommitted
wifi: wlcore: Fix a locking bug
[ Upstream commit 72c6df8 ] Make sure that wl->mutex is locked before it is unlocked. This has been detected by the Clang thread-safety analyzer. Fixes: 45aa7f0 ("wlcore: Use generic runtime pm calls for wowlan elp configuration") Signed-off-by: Bart Van Assche <bvanassche@acm.org> Link: https://patch.msgid.link/20260223220102.2158611-26-bart.vanassche@linux.dev Signed-off-by: Johannes Berg <johannes.berg@intel.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 78bb63b commit aca4c9e

File tree

1 file changed

+2
-2
lines changed
  • drivers/net/wireless/ti/wlcore

1 file changed

+2
-2
lines changed

drivers/net/wireless/ti/wlcore/main.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1800,6 +1800,8 @@ static int __maybe_unused wl1271_op_resume(struct ieee80211_hw *hw)
18001800
wl->wow_enabled);
18011801
WARN_ON(!wl->wow_enabled);
18021802

1803+
mutex_lock(&wl->mutex);
1804+
18031805
ret = pm_runtime_force_resume(wl->dev);
18041806
if (ret < 0) {
18051807
wl1271_error("ELP wakeup failure!");
@@ -1816,8 +1818,6 @@ static int __maybe_unused wl1271_op_resume(struct ieee80211_hw *hw)
18161818
run_irq_work = true;
18171819
spin_unlock_irqrestore(&wl->wl_lock, flags);
18181820

1819-
mutex_lock(&wl->mutex);
1820-
18211821
/* test the recovery flag before calling any SDIO functions */
18221822
pending_recovery = test_bit(WL1271_FLAG_RECOVERY_IN_PROGRESS,
18231823
&wl->flags);

0 commit comments

Comments
 (0)