]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
wifi: ath12k: fix NULL access in assign channel context handler
authorKarthikeyan Periyasamy <quic_periyasa@quicinc.com>
Mon, 24 Mar 2025 06:25:15 +0000 (11:55 +0530)
committerJeff Johnson <jeff.johnson@oss.qualcomm.com>
Thu, 27 Mar 2025 22:55:41 +0000 (15:55 -0700)
Currently, when ath12k_mac_assign_vif_to_vdev() fails, the radio handle
(ar) gets accessed from the link VIF handle (arvif) for debug logging, This
is incorrect. In the fail scenario, radio handle is NULL. Fix the NULL
access, avoid radio handle access by moving to the hardware debug logging
helper function (ath12k_hw_warn).

Tested-on: QCN9274 hw2.0 PCI WLAN.WBE.1.3.1-00173-QCAHKSWPL_SILICONZ-1
Tested-on: WCN7850 hw2.0 PCI WLAN.HMT.1.0.c5-00481-QCAHMTSWPL_V1.0_V2.0_SILICONZ-3

Fixes: 90570ba4610b ("wifi: ath12k: do not return invalid link id for scan link")
Reviewed-by: Vasanthakumar Thiagarajan <vasanthakumar.thiagarajan@oss.qualcomm.com>
Signed-off-by: Karthikeyan Periyasamy <quic_periyasa@quicinc.com>
Link: https://patch.msgid.link/20250324062518.2752822-8-quic_periyasa@quicinc.com
Signed-off-by: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
drivers/net/wireless/ath/ath12k/mac.c

index 245adb73df04b7693d4990f95d4f329443ea221a..d4fb776767a941854e6f8d1b8cd5a058018c0dd0 100644 (file)
@@ -9614,8 +9614,8 @@ ath12k_mac_op_assign_vif_chanctx(struct ieee80211_hw *hw,
 
        ar = ath12k_mac_assign_vif_to_vdev(hw, arvif, ctx);
        if (!ar) {
-               ath12k_warn(arvif->ar->ab, "failed to assign chanctx for vif %pM link id %u link vif is already started",
-                           vif->addr, link_id);
+               ath12k_hw_warn(ah, "failed to assign chanctx for vif %pM link id %u link vif is already started",
+                              vif->addr, link_id);
                return -EINVAL;
        }