ath11k: Remove unused variable in ath11k_dp_rx_mon_merg_msdus()
Subsystems (3)
PATCH 1/1 ath11k: Remove unused variable in ath11k_dp_rx_mon_merg_msdus()
Coverity complains that a constant variable guards dead code. In fact, mpdu_buf is set NULL and never updated.
4834err_merge_fail:
null: At condition mpdu_buf, the value of mpdu_buf must be NULL.
dead_error_condition: The condition mpdu_buf cannot be true.
CID 92162 (#1 of 1): 'Constant' variable guards dead code (DEADCODE)dead_error_line: Execution cannot reach the expression decap_format !=
DP_RX_DECAP_TYPE_RAW inside this statement: if (mpdu_buf && decap_forma....
Local variable mpdu_buf is assigned only once, to a constant value, making it
effectively constant throughout its scope. If this is not the intent, examine the logic to see if there is a missing assignment that would make mpdu_buf not remain constant.
4835 if (mpdu_buf && decap_format != DP_RX_DECAP_TYPE_RAW) {
Fix this by removing mpdu_buf and unreachable code.
--- drivers/net/wireless/ath/ath11k/dp_rx.c | 10 +--------- 1 file changed, 1 insertion(+), 9 deletions(-)
drivers/net/wireless/ath/ath11k/dp_rx.c +1 -9
@@ -4740,7 +4740,7 @@ ath11k_dp_rx_mon_merg_msdus(struct ath11k *ar, struct ieee80211_rx_status *rxs) {struct ath11k_base *ab = ar->ab; -struct sk_buff *msdu, *mpdu_buf, *prev_buf; +struct sk_buff *msdu, *prev_buf;u32 wifi_hdr_len;struct hal_rx_desc *rx_desc;char *hdr_desc;
@@ -4748,8 +4748,6 @@ ath11k_dp_rx_mon_merg_msdus(struct ath11k *ar,struct ieee80211_hdr_3addr *wh;struct rx_attention *rx_attention; - mpdu_buf =NULL ; -if (!head_msdu) goto err_merge_fail;
@@ -4832,12 +4830,6 @@ ath11k_dp_rx_mon_merg_msdus(struct ath11k *ar,return head_msdu; err_merge_fail: -if (mpdu_buf && decap_format !=DP_RX_DECAP_TYPE_RAW ) { -ath11k_dbg (ab,ATH11K_DBG_DATA , -"err_merge_fail mpdu_buf %pK" , mpdu_buf); -/* Free the head buffer */ -dev_kfree_skb_any (mpdu_buf); - }return NULL ; }
Signature · 1 line
2.33.0
Quoted 17 lines · Tim Gardner
Coverity complains that a constant variable guards dead code. In fact,
mpdu_bufis set NULL and never updated.4834err_merge_fail:
null: At conditionmpdu_buf, the value ofmpdu_bufmust be NULL.
dead_error_condition: The conditionmpdu_bufcannot be true.
CID 92162 (#1 of 1): 'Constant' variable guards dead code (DEADCODE)dead_error_line: Execution cannot reach the expressiondecap_format!=
DP_RX_DECAP_TYPE_RAWinside this statement: if (mpdu_buf&&decap_forma....
Local variablempdu_bufis assigned only once, to a constant value, making it
effectively constant throughout its scope. If this is not the intent, examine the logic to see if there is a missing assignment that would makempdu_bufnot remain constant.
4835 if (mpdu_buf&&decap_format!=DP_RX_DECAP_TYPE_RAW) {Fix this by removing
mpdu_bufand unreachable code.
Quoted 9 lines
Cc Kalle Valo <[email protected]>Cc "David S. Miller" <[email protected]>Cc Jakub Kicinski <[email protected]>Signed-off-by Tim Gardner <[email protected]>Signed-off-by Kalle Valo <[email protected]>
Patch applied to ath-next branch of ath.git, thanks.
7210b4b77fe4 ath11k: Remove unused variable in ath11k_dp_rx_mon_merg_msdus()
Signature · 3 lines
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
Quoted 17 lines · Tim Gardner
Coverity complains that a constant variable guards dead code. In fact,
mpdu_bufis set NULL and never updated.4834err_merge_fail:
null: At conditionmpdu_buf, the value ofmpdu_bufmust be NULL.
dead_error_condition: The conditionmpdu_bufcannot be true.
CID 92162 (#1 of 1): 'Constant' variable guards dead code (DEADCODE)dead_error_line: Execution cannot reach the expressiondecap_format!=
DP_RX_DECAP_TYPE_RAWinside this statement: if (mpdu_buf&&decap_forma....
Local variablempdu_bufis assigned only once, to a constant value, making it
effectively constant throughout its scope. If this is not the intent, examine the logic to see if there is a missing assignment that would makempdu_bufnot remain constant.
4835 if (mpdu_buf&&decap_format!=DP_RX_DECAP_TYPE_RAW) {Fix this by removing
mpdu_bufand unreachable code.
Quoted 9 lines
Cc Kalle Valo <[email protected]>Cc "David S. Miller" <[email protected]>Cc Jakub Kicinski <[email protected]>Signed-off-by Tim Gardner <[email protected]>Signed-off-by Kalle Valo <[email protected]>
Patch applied to ath-next branch of ath.git, thanks.
7210b4b77fe4 ath11k: Remove unused variable in ath11k_dp_rx_mon_merg_msdus()
Signature · 9 lines
https://patchwork.kernel.org/project/linux-wireless/patch/[email protected]/ https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches -- ath11k mailing list [email protected] http://lists.infradead.org/mailman/listinfo/ath11k