public inbox for ath12k@lists.infradead.org
 help / color / mirror / Atom feed
From: Dan Carpenter <error27@gmail.com>
To: quic_kvalo@quicinc.com
Cc: ath12k@lists.infradead.org
Subject: [bug report] wifi: ath12k: uninitialized variables
Date: Thu, 16 Feb 2023 17:01:11 +0300	[thread overview]
Message-ID: <Y+43J8N4GUT3qY25@kili> (raw)

Hello Kalle Valo,

The patch d889913205cf: "wifi: ath12k: driver for Qualcomm Wi-Fi 7
devices" from Nov 28, 2022, leads to the following Smatch static
checker warning:

drivers/net/wireless/ath/ath12k/dp_mon.c:2029 ath12k_dp_mon_tx_parse_mon_status() error: uninitialized symbol 'num_user'.
drivers/net/wireless/ath/ath12k/dp.c:210 ath12k_dp_srng_msi_setup() error: uninitialized symbol 'addr_lo'.
drivers/net/wireless/ath/ath12k/dp.c:211 ath12k_dp_srng_msi_setup() error: uninitialized symbol 'addr_hi'.
drivers/net/wireless/ath/ath12k/mac.c:1630 ath12k_peer_assoc_h_he() error: uninitialized symbol 'rx_mcs_80'.
drivers/net/wireless/ath/ath12k/mac.c:1630 ath12k_peer_assoc_h_he() error: uninitialized symbol 'rx_mcs_160'.
drivers/net/wireless/ath/ath12k/mac.c:1632 ath12k_peer_assoc_h_he() error: uninitialized symbol 'rx_mcs_80'.
drivers/net/wireless/ath/ath12k/ce.c:485 ath12k_ce_srng_msi_ring_params_setup() error: uninitialized symbol 'addr_lo'.
drivers/net/wireless/ath/ath12k/ce.c:486 ath12k_ce_srng_msi_ring_params_setup() error: uninitialized symbol 'addr_hi'.

drivers/net/wireless/ath/ath12k/dp_mon.c
    2002 enum hal_rx_mon_status
    2003 ath12k_dp_mon_tx_parse_mon_status(struct ath12k *ar,
    2004                                   struct ath12k_mon_data *pmon,
    2005                                   int mac_id,
    2006                                   struct sk_buff *skb,
    2007                                   struct napi_struct *napi,
    2008                                   u32 ppdu_id)
    2009 {
    2010         struct ath12k_base *ab = ar->ab;
    2011         struct dp_mon_tx_ppdu_info *tx_prot_ppdu_info, *tx_data_ppdu_info;
    2012         struct hal_tlv_hdr *tlv;
    2013         u8 *ptr = skb->data;
    2014         u16 tlv_tag;
    2015         u16 tlv_len;
    2016         u32 tlv_userid = 0;
    2017         u8 num_user;
    2018         u32 tlv_status = DP_MON_TX_STATUS_PPDU_NOT_DONE;
    2019 
    2020         tx_prot_ppdu_info = ath12k_dp_mon_tx_get_ppdu_info(pmon, ppdu_id,
    2021                                                            DP_MON_TX_PROT_PPDU_INFO);
    2022         if (!tx_prot_ppdu_info)
    2023                 return -ENOMEM;
    2024 
    2025         tlv = (struct hal_tlv_hdr *)ptr;
    2026         tlv_tag = le32_get_bits(tlv->tl, HAL_TLV_HDR_TAG);
    2027 
    2028         tlv_status = ath12k_dp_mon_tx_status_get_num_user(tlv_tag, tlv, &num_user);
--> 2029         if (tlv_status == DP_MON_TX_STATUS_PPDU_NOT_DONE || !num_user)

num_user is not intialized if tlv_status == DP_MON_RX_RESPONSE_REQUIRED_INFO.

    2030                 return -EINVAL;
    2031 
    2032         tx_data_ppdu_info = ath12k_dp_mon_tx_get_ppdu_info(pmon, ppdu_id,
    2033                                                            DP_MON_TX_DATA_PPDU_INFO);
    2034         if (!tx_data_ppdu_info)
    2035                 return -ENOMEM;
    2036 

regards,
dan carpenter

-- 
ath12k mailing list
ath12k@lists.infradead.org
https://lists.infradead.org/mailman/listinfo/ath12k

                 reply	other threads:[~2023-02-16 14:01 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=Y+43J8N4GUT3qY25@kili \
    --to=error27@gmail.com \
    --cc=ath12k@lists.infradead.org \
    --cc=quic_kvalo@quicinc.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox