]> www.infradead.org Git - users/dwmw2/linux.git/commitdiff
ath10k: Fix ath10k_wmi_tlv_op_pull_peer_stats_info() unlock without lock
authorShuah Khan <skhan@linuxfoundation.org>
Tue, 6 Apr 2021 23:02:28 +0000 (17:02 -0600)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 14 May 2021 07:44:31 +0000 (09:44 +0200)
[ Upstream commit eaaf52e4b866f265eb791897d622961293fd48c1 ]

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>
Link: https://lore.kernel.org/r/20210406230228.31301-1-skhan@linuxfoundation.org
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/wireless/ath/ath10k/wmi-tlv.c

index d38276ac375e9fdf03935a66e5efb4212cc94bb8..315d20f5c8eb102084fb8a335341b95fe0f6f2a4 100644 (file)
@@ -461,6 +461,9 @@ static void ath10k_wmi_event_tdls_peer(struct ath10k *ar, struct sk_buff *skb)
                                        GFP_ATOMIC
                                        );
                break;
+       default:
+               kfree(tb);
+               return;
        }
 
 exit: