1 From ad6e3a384ed9e966aec5e3736af23bd01dafc26d Mon Sep 17 00:00:00 2001
2 From: Sasha Levin <sashal@kernel.org>
3 Date: Sun, 17 Dec 2023 13:29:01 +0200
4 Subject: wifi: ath10k: fix NULL pointer dereference in
5 ath10k_wmi_tlv_op_pull_mgmt_tx_compl_ev()
7 From: Xingyuan Mo <hdthky0@gmail.com>
9 [ Upstream commit ad25ee36f00172f7d53242dc77c69fff7ced0755 ]
11 We should check whether the WMI_TLV_TAG_STRUCT_MGMT_TX_COMPL_EVENT tlv is
12 present before accessing it, otherwise a null pointer deference error will
15 Fixes: dc405152bb64 ("ath10k: handle mgmt tx completion event")
16 Signed-off-by: Xingyuan Mo <hdthky0@gmail.com>
17 Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
18 Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
19 Link: https://msgid.link/20231208043433.271449-1-hdthky0@gmail.com
20 Signed-off-by: Sasha Levin <sashal@kernel.org>
22 drivers/net/wireless/ath/ath10k/wmi-tlv.c | 4 ++++
23 1 file changed, 4 insertions(+)
25 diff --git a/drivers/net/wireless/ath/ath10k/wmi-tlv.c b/drivers/net/wireless/ath/ath10k/wmi-tlv.c
26 index 4f2fbc610d798..0eeb74245372f 100644
27 --- a/drivers/net/wireless/ath/ath10k/wmi-tlv.c
28 +++ b/drivers/net/wireless/ath/ath10k/wmi-tlv.c
29 @@ -844,6 +844,10 @@ ath10k_wmi_tlv_op_pull_mgmt_tx_compl_ev(struct ath10k *ar, struct sk_buff *skb,
32 ev = tb[WMI_TLV_TAG_STRUCT_MGMT_TX_COMPL_EVENT];
38 arg->desc_id = ev->desc_id;
39 arg->status = ev->status;