Skip to content

Commit 47b3f7e

Browse files
Tamizh Chelvam Rajagregkh
authored andcommitted
wifi: ath12k: Pass ab pointer directly to ath12k_dp_tx_get_encap_type()
[ Upstream commit 0506283 ] In ath12k_dp_tx_get_encap_type(), the arvif parameter is only used to retrieve the ab pointer. In vdev delete sequence the arvif->ar could become NULL and that would trigger kernel panic. Since the caller ath12k_dp_tx() already has a valid ab pointer, pass it directly to avoid panic and unnecessary dereferencing. PC points to "ath12k_dp_tx+0x228/0x988 [ath12k]" LR points to "ath12k_dp_tx+0xc8/0x988 [ath12k]". The Backtrace obtained is as follows: ath12k_dp_tx+0x228/0x988 [ath12k] ath12k_mac_tx_check_max_limit+0x608/0x920 [ath12k] ieee80211_process_measurement_req+0x320/0x348 [mac80211] ieee80211_tx_dequeue+0x9ac/0x1518 [mac80211] ieee80211_tx_dequeue+0xb14/0x1518 [mac80211] ieee80211_tx_prepare_skb+0x224/0x254 [mac80211] ieee80211_xmit+0xec/0x100 [mac80211] __ieee80211_subif_start_xmit+0xc50/0xf40 [mac80211] ieee80211_subif_start_xmit+0x2e8/0x308 [mac80211] netdev_start_xmit+0x150/0x18c dev_hard_start_xmit+0x74/0xc0 Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1 Fixes: e93bbd6 ("wifi: ath12k: fix packets are sent in native wifi mode while we set raw mode") Signed-off-by: Tamizh Chelvam Raja <[email protected]> Reviewed-by: Vasanthakumar Thiagarajan <[email protected]> Link: https://patch.msgid.link/[email protected] Signed-off-by: Jeff Johnson <[email protected]> Signed-off-by: Sasha Levin <[email protected]>
1 parent 513c1d8 commit 47b3f7e

File tree

1 file changed

+2
-3
lines changed
  • drivers/net/wireless/ath/ath12k

1 file changed

+2
-3
lines changed

drivers/net/wireless/ath/ath12k/dp_tx.c

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,9 @@
1313
#include "mac.h"
1414

1515
static enum hal_tcl_encap_type
16-
ath12k_dp_tx_get_encap_type(struct ath12k_link_vif *arvif, struct sk_buff *skb)
16+
ath12k_dp_tx_get_encap_type(struct ath12k_base *ab, struct sk_buff *skb)
1717
{
1818
struct ieee80211_tx_info *tx_info = IEEE80211_SKB_CB(skb);
19-
struct ath12k_base *ab = arvif->ar->ab;
2019

2120
if (test_bit(ATH12K_FLAG_RAW_MODE, &ab->dev_flags))
2221
return HAL_TCL_ENCAP_TYPE_RAW;
@@ -305,7 +304,7 @@ int ath12k_dp_tx(struct ath12k *ar, struct ath12k_link_vif *arvif,
305304
u32_encode_bits(mcbc_gsn, HTT_TCL_META_DATA_GLOBAL_SEQ_NUM);
306305
}
307306

308-
ti.encap_type = ath12k_dp_tx_get_encap_type(arvif, skb);
307+
ti.encap_type = ath12k_dp_tx_get_encap_type(ab, skb);
309308
ti.addr_search_flags = arvif->hal_addr_search_flags;
310309
ti.search_type = arvif->search_type;
311310
ti.type = HAL_TCL_DESC_TYPE_BUFFER;

0 commit comments

Comments
 (0)