diff mbox series

ath11k: Fix uninitialized symbol 'rx_buf_sz'

Message ID 1642605793-13518-1-git-send-email-quic_akolli@quicinc.com (mailing list archive)
State Accepted
Commit dca857f07dc14c923a3c47965e771f435807b39c
Delegated to: Kalle Valo
Headers show
Series ath11k: Fix uninitialized symbol 'rx_buf_sz' | expand

Commit Message

Anilkumar Kolli Jan. 19, 2022, 3:23 p.m. UTC
Add missing else statement in ath11k_dp_rx_process_mon_status()
to fix below smatch warnings,
    drivers/net/wireless/ath/ath11k/dp_rx.c:3105
    ath11k_dp_rx_process_mon_status()
    error: uninitialized symbol 'rx_buf_sz'.

Fixes: ab18e3bc1c13 ("ath11k: Fix pktlog lite rx events")

Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: Anilkumar Kolli <quic_akolli@quicinc.com>
---
 drivers/net/wireless/ath/ath11k/debugfs.h | 1 +
 drivers/net/wireless/ath/ath11k/dp_rx.c   | 7 +++++--
 2 files changed, 6 insertions(+), 2 deletions(-)

Comments

Kalle Valo Jan. 31, 2022, 2 p.m. UTC | #1
Anilkumar Kolli <quic_akolli@quicinc.com> wrote:

> Add missing else statement in ath11k_dp_rx_process_mon_status()
> to fix below smatch warnings,
>     drivers/net/wireless/ath/ath11k/dp_rx.c:3105
>     ath11k_dp_rx_process_mon_status()
>     error: uninitialized symbol 'rx_buf_sz'.
> 
> Fixes: ab18e3bc1c13 ("ath11k: Fix pktlog lite rx events")
> 
> Reported-by: Dan Carpenter <dan.carpenter@oracle.com>
> Signed-off-by: Anilkumar Kolli <quic_akolli@quicinc.com>
> Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>

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

dca857f07dc1 ath11k: Fix uninitialized symbol 'rx_buf_sz'
diff mbox series

Patch

diff --git a/drivers/net/wireless/ath/ath11k/debugfs.h b/drivers/net/wireless/ath/ath11k/debugfs.h
index 4c0740394c95..71525d786bdf 100644
--- a/drivers/net/wireless/ath/ath11k/debugfs.h
+++ b/drivers/net/wireless/ath/ath11k/debugfs.h
@@ -88,6 +88,7 @@  enum ath11k_pktlog_mode {
 };
 
 enum ath11k_pktlog_enum {
+	ATH11K_PKTLOG_TYPE_INVALID      = 0,
 	ATH11K_PKTLOG_TYPE_TX_CTRL      = 1,
 	ATH11K_PKTLOG_TYPE_TX_STAT      = 2,
 	ATH11K_PKTLOG_TYPE_TX_MSDU_ID   = 3,
diff --git a/drivers/net/wireless/ath/ath11k/dp_rx.c b/drivers/net/wireless/ath/ath11k/dp_rx.c
index 89b77b94bb20..99dc9b5bbf4b 100644
--- a/drivers/net/wireless/ath/ath11k/dp_rx.c
+++ b/drivers/net/wireless/ath/ath11k/dp_rx.c
@@ -5054,7 +5054,7 @@  int ath11k_dp_rx_process_mon_status(struct ath11k_base *ab, int mac_id,
 	struct ath11k_sta *arsta;
 	int num_buffs_reaped = 0;
 	u32 rx_buf_sz;
-	u16 log_type = 0;
+	u16 log_type;
 	struct ath11k_mon_data *pmon = (struct ath11k_mon_data *)&ar->dp.mon_data;
 	struct ath11k_pdev_mon_stats *rx_mon_stats = &pmon->rx_mon_stats;
 	struct hal_rx_mon_ppdu_info *ppdu_info = &pmon->mon_ppdu_info;
@@ -5076,9 +5076,12 @@  int ath11k_dp_rx_process_mon_status(struct ath11k_base *ab, int mac_id,
 		} else if (ath11k_debugfs_is_pktlog_rx_stats_enabled(ar)) {
 			log_type = ATH11K_PKTLOG_TYPE_RX_STATBUF;
 			rx_buf_sz = DP_RX_BUFFER_SIZE;
+		} else {
+			log_type = ATH11K_PKTLOG_TYPE_INVALID;
+			rx_buf_sz = 0;
 		}
 
-		if (log_type)
+		if (log_type != ATH11K_PKTLOG_TYPE_INVALID)
 			trace_ath11k_htt_rxdesc(ar, skb->data, log_type, rx_buf_sz);
 
 		hal_status = ath11k_hal_rx_parse_mon_status(ab, ppdu_info, skb);