2023-10-13 07:48:23

by Ma Ke

[permalink] [raw]
Subject: [PATCH] wifi: ath12k: drop NULL pointer check in ath12k_update_per_peer_tx_stats()

Since 'user_stats' is a fixed-size array of 'struct htt_ppdu_user_stats'
in 'struct htt_ppdu_stats', any of its member can't be NULL and so
relevant check may be dropped.

Signed-off-by: Ma Ke <[email protected]>
---
drivers/net/wireless/ath/ath12k/dp_rx.c | 3 ---
1 file changed, 3 deletions(-)

diff --git a/drivers/net/wireless/ath/ath12k/dp_rx.c b/drivers/net/wireless/ath/ath12k/dp_rx.c
index e6e64d437c47..a38a239669a8 100644
--- a/drivers/net/wireless/ath/ath12k/dp_rx.c
+++ b/drivers/net/wireless/ath/ath12k/dp_rx.c
@@ -1339,9 +1339,6 @@ ath12k_update_per_peer_tx_stats(struct ath12k *ar,
u8 tid = HTT_PPDU_STATS_NON_QOS_TID;
bool is_ampdu = false;

- if (!usr_stats)
- return;
-
if (!(usr_stats->tlv_flags & BIT(HTT_PPDU_STATS_TAG_USR_RATE)))
return;

--
2.37.2


2023-10-25 09:56:35

by Kalle Valo

[permalink] [raw]
Subject: Re: [PATCH] wifi: ath12k: drop NULL pointer check in ath12k_update_per_peer_tx_stats()

Ma Ke <[email protected]> wrote:

> Since 'user_stats' is a fixed-size array of 'struct htt_ppdu_user_stats'
> in 'struct htt_ppdu_stats', any of its member can't be NULL and so
> relevant check may be dropped.
>
> Signed-off-by: Ma Ke <[email protected]>
> Signed-off-by: Kalle Valo <[email protected]>

Jeff, what do you think?

--
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

2023-10-25 15:57:51

by Jeff Johnson

[permalink] [raw]
Subject: Re: [PATCH] wifi: ath12k: drop NULL pointer check in ath12k_update_per_peer_tx_stats()

On 10/25/2023 2:56 AM, Kalle Valo wrote:
> Ma Ke <[email protected]> wrote:
>
>> Since 'user_stats' is a fixed-size array of 'struct htt_ppdu_user_stats'
>> in 'struct htt_ppdu_stats', any of its member can't be NULL and so
>> relevant check may be dropped.
>>
>> Signed-off-by: Ma Ke <[email protected]>
>> Signed-off-by: Kalle Valo <[email protected]>
>
> Jeff, what do you think?
>
look correct,
Acked-by: Jeff Johnson <[email protected]>

2023-10-31 07:46:25

by Kalle Valo

[permalink] [raw]
Subject: Re: [PATCH] wifi: ath12k: drop NULL pointer check in ath12k_update_per_peer_tx_stats()

Ma Ke <[email protected]> wrote:

> Since 'user_stats' is a fixed-size array of 'struct htt_ppdu_user_stats'
> in 'struct htt_ppdu_stats', any of its member can't be NULL and so
> relevant check may be dropped.
>
> Signed-off-by: Ma Ke <[email protected]>
> Signed-off-by: Kalle Valo <[email protected]>

Patch applied to ath-next branch of ath.git, thanks.

56d9854bd7c6 wifi: ath12k: drop NULL pointer check in ath12k_update_per_peer_tx_stats()

--
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches