diff mbox series

ath10k: Fix ath10k_wmi_tlv_op_pull_peer_stats_info() unlock without lock

Message ID 20210406230228.31301-1-skhan@linuxfoundation.org (mailing list archive)
State Accepted
Commit eaaf52e4b866f265eb791897d622961293fd48c1
Delegated to: Kalle Valo
Headers show
Series ath10k: Fix ath10k_wmi_tlv_op_pull_peer_stats_info() unlock without lock | expand

Commit Message

Shuah Khan April 6, 2021, 11:02 p.m. UTC
ath10k_wmi_tlv_op_pull_peer_stats_info() could try to unlock RCU lock
winthout locking it first when peer reason doesn't match the valid
cases for this function.

Add a default case to return without unlocking.

Fixes: 09078368d516 ("ath10k: hold RCU lock when calling ieee80211_find_sta_by_ifaddr()")
Reported-by: Pavel Machek <pavel@ucw.cz>
Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
---
 drivers/net/wireless/ath/ath10k/wmi-tlv.c | 3 +++
 1 file changed, 3 insertions(+)

Comments

Kalle Valo April 22, 2021, 2 p.m. UTC | #1
Shuah Khan <skhan@linuxfoundation.org> wrote:

> ath10k_wmi_tlv_op_pull_peer_stats_info() could try to unlock RCU lock
> winthout locking it first when peer reason doesn't match the valid
> cases for this function.
> 
> Add a default case to return without unlocking.
> 
> Fixes: 09078368d516 ("ath10k: hold RCU lock when calling ieee80211_find_sta_by_ifaddr()")
> Reported-by: Pavel Machek <pavel@ucw.cz>
> Signed-off-by: Shuah Khan <skhan@linuxfoundation.org>
> Signed-off-by: Kalle Valo <kvalo@codeaurora.org>

Patch applied to ath-next branch of ath.git, thanks.

eaaf52e4b866 ath10k: Fix ath10k_wmi_tlv_op_pull_peer_stats_info() unlock without lock
diff mbox series

Patch

diff --git a/drivers/net/wireless/ath/ath10k/wmi-tlv.c b/drivers/net/wireless/ath/ath10k/wmi-tlv.c
index d97b33f789e4..7efbe03fbca8 100644
--- a/drivers/net/wireless/ath/ath10k/wmi-tlv.c
+++ b/drivers/net/wireless/ath/ath10k/wmi-tlv.c
@@ -592,6 +592,9 @@  static void ath10k_wmi_event_tdls_peer(struct ath10k *ar, struct sk_buff *skb)
 					GFP_ATOMIC
 					);
 		break;
+	default:
+		kfree(tb);
+		return;
 	}
 
 exit: