wifi: ath: Use dev_kfree_skb_any(skb) call only once in three functions
PATCH 1/1 wifi: ath: Use dev_kfree_skb_any(skb) call only once in three functions
From: Markus Elfring <[email protected]>
Date: Sat, 21 Sep 2024 16:32:09 +0200
A dev_kfree_skb_any(skb) call was immediately used after a return code check in three function implementations.
Thus use such a function call only once instead directly before the checks.
This issue was transformed by using the Coccinelle software.
Signed-off-by Markus Elfring <[email protected]>
--- drivers/net/wireless/ath/ath11k/dp_rx.c | 6 ++---- drivers/net/wireless/ath/ath12k/dp_mon.c | 4 +--- drivers/net/wireless/ath/ath12k/dp_rx.c | 6 ++---- 3 files changed, 5 insertions(+), 11 deletions(-)
drivers/net/wireless/ath/ath11k/dp_rx.c +2 -4
@@ -1808,11 +1808,9 @@ static int ath11k_dp_rx_msdu_coalesce(struct ath11k *ar,/* Free up all buffers of the MSDU */ while ((skb =__skb_dequeue (msdu_list)) !=NULL ) { rxcb =ATH11K_SKB_RXCB (skb); -if (!rxcb->is_continuation) { -dev_kfree_skb_any (skb); -break ; - }dev_kfree_skb_any (skb); +if (!rxcb->is_continuation) +break ; }return -ENOMEM ; }
drivers/net/wireless/ath/ath12k/dp_mon.c +1 -3
@@ -2102,16 +2102,14 @@ int ath12k_dp_mon_srng_process(struct ath12k *ar, int mac_id, int *budget, skb, napi, ppdu_id); peer =ath12k_peer_find_by_id (ab, ppdu_info->peer_id); - +dev_kfree_skb_any (skb);if (!peer || !peer->sta) {ath12k_dbg (ab,ATH12K_DBG_DATA ,"failed to find the peer with peer_id %d\n" , ppdu_info->peer_id); -dev_kfree_skb_any (skb);continue ; } -dev_kfree_skb_any (skb); pmon->dest_skb_q[i] =NULL ; }
drivers/net/wireless/ath/ath12k/dp_rx.c +2 -4
@@ -1804,11 +1804,9 @@ static int ath12k_dp_rx_msdu_coalesce(struct ath12k *ar,/* Free up all buffers of the MSDU */ while ((skb =__skb_dequeue (msdu_list)) !=NULL ) { rxcb =ATH12K_SKB_RXCB (skb); -if (!rxcb->is_continuation) { -dev_kfree_skb_any (skb); -break ; - }dev_kfree_skb_any (skb); +if (!rxcb->is_continuation) +break ; }return -ENOMEM ; }
--
2.46.0