diff mbox series

[v8,7/9] wifi: ath12k: fix NULL access in assign channel context handler

Message ID 20250222151926.379652-8-quic_periyasa@quicinc.com
State Superseded
Headers show
Series wifi: ath12k: Add monitor interface support on QCN9274 | expand

Commit Message

Karthikeyan Periyasamy Feb. 22, 2025, 3:19 p.m. UTC
Currently, when ath12k_mac_assign_vif_to_vdev() fails, the radio handle
(ar) gets accessed fom 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")
Signed-off-by: Karthikeyan Periyasamy <quic_periyasa@quicinc.com>
---
 drivers/net/wireless/ath/ath12k/mac.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

Comments

Jeff Johnson March 4, 2025, 5:36 p.m. UTC | #1
On 2/22/2025 7:19 AM, Karthikeyan Periyasamy wrote:
> Currently, when ath12k_mac_assign_vif_to_vdev() fails, the radio handle
> (ar) gets accessed fom the link VIF handle (arvif) for debug logging, This

WARNING:TYPO_SPELLING: 'fom' may be misspelled - perhaps 'from'?

> 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).
Jeff Johnson March 4, 2025, 5:39 p.m. UTC | #2
On 3/4/2025 9:36 AM, Jeff Johnson wrote:
> On 2/22/2025 7:19 AM, Karthikeyan Periyasamy wrote:
>> Currently, when ath12k_mac_assign_vif_to_vdev() fails, the radio handle
>> (ar) gets accessed fom the link VIF handle (arvif) for debug logging, This
> 
> WARNING:TYPO_SPELLING: 'fom' may be misspelled - perhaps 'from'?
> 
>> 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).

(hit 'send' too soon -- I'll fix this in 'pending' if there are no other
issues in the series)
Karthikeyan Periyasamy March 5, 2025, 1:11 a.m. UTC | #3
On 3/4/2025 11:06 PM, Jeff Johnson wrote:
> On 2/22/2025 7:19 AM, Karthikeyan Periyasamy wrote:
>> Currently, when ath12k_mac_assign_vif_to_vdev() fails, the radio handle
>> (ar) gets accessed fom the link VIF handle (arvif) for debug logging, This
> 
> WARNING:TYPO_SPELLING: 'fom' may be misspelled - perhaps 'from'?
> 

Yes, my bad. Correct word is 'from'.

>> 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).
Karthikeyan Periyasamy March 5, 2025, 1:15 a.m. UTC | #4
On 3/4/2025 11:09 PM, Jeff Johnson wrote:
> On 3/4/2025 9:36 AM, Jeff Johnson wrote:
>> On 2/22/2025 7:19 AM, Karthikeyan Periyasamy wrote:
>>> Currently, when ath12k_mac_assign_vif_to_vdev() fails, the radio handle
>>> (ar) gets accessed fom the link VIF handle (arvif) for debug logging, This
>>
>> WARNING:TYPO_SPELLING: 'fom' may be misspelled - perhaps 'from'?
>>
>>> 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).
> 
> (hit 'send' too soon -- I'll fix this in 'pending' if there are no other
> issues in the series)
> 
> 

sure, thanks for the review.
diff mbox series

Patch

diff --git a/drivers/net/wireless/ath/ath12k/mac.c b/drivers/net/wireless/ath/ath12k/mac.c
index a2506a7443b6..c0e50cc5c024 100644
--- a/drivers/net/wireless/ath/ath12k/mac.c
+++ b/drivers/net/wireless/ath/ath12k/mac.c
@@ -9458,8 +9458,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;
 	}