Skip to content
/ linux Public

Commit 39c6ab2

Browse files
haruki3hhhSasha Levin
authored andcommitted
wifi: ath10k: fix lock protection in ath10k_wmi_event_peer_sta_ps_state_chg()
[ Upstream commit 820ba7d ] ath10k_wmi_event_peer_sta_ps_state_chg() uses lockdep_assert_held() to assert that ar->data_lock should be held by the caller, but neither ath10k_wmi_10_2_op_rx() nor ath10k_wmi_10_4_op_rx() acquire this lock before calling this function. The field arsta->peer_ps_state is documented as protected by ar->data_lock in core.h, and other accessors (ath10k_peer_ps_state_disable, ath10k_dbg_sta_read_peer_ps_state) properly acquire this lock. Add spin_lock_bh()/spin_unlock_bh() around the peer_ps_state update, and remove the lockdep_assert_held() to be aligned with new locking, following the pattern used by other WMI event handlers in the driver. Signed-off-by: Ziyi Guo <n7l8m4@u.northwestern.edu> Reviewed-by: Baochen Qiang <baochen.qiang@oss.qualcomm.com> Link: https://patch.msgid.link/20260123175611.767731-1-n7l8m4@u.northwestern.edu [removed excess blank line] Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com> Signed-off-by: Sasha Levin <sashal@kernel.org>
1 parent 16ca028 commit 39c6ab2

File tree

1 file changed

+2
-2
lines changed
  • drivers/net/wireless/ath/ath10k

1 file changed

+2
-2
lines changed

drivers/net/wireless/ath/ath10k/wmi.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5289,8 +5289,6 @@ ath10k_wmi_event_peer_sta_ps_state_chg(struct ath10k *ar, struct sk_buff *skb)
52895289
struct ath10k_sta *arsta;
52905290
u8 peer_addr[ETH_ALEN];
52915291

5292-
lockdep_assert_held(&ar->data_lock);
5293-
52945292
ev = (struct wmi_peer_sta_ps_state_chg_event *)skb->data;
52955293
ether_addr_copy(peer_addr, ev->peer_macaddr.addr);
52965294

@@ -5305,7 +5303,9 @@ ath10k_wmi_event_peer_sta_ps_state_chg(struct ath10k *ar, struct sk_buff *skb)
53055303
}
53065304

53075305
arsta = (struct ath10k_sta *)sta->drv_priv;
5306+
spin_lock_bh(&ar->data_lock);
53085307
arsta->peer_ps_state = __le32_to_cpu(ev->peer_ps_state);
5308+
spin_unlock_bh(&ar->data_lock);
53095309

53105310
exit:
53115311
rcu_read_unlock();

0 commit comments

Comments
 (0)