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: duplicate checks
Date: Thu, 16 Feb 2023 17:00:16 +0300	[thread overview]
Message-ID: <Y+428K5KOrDGaCw+@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/mac.c:5809 ath12k_mac_op_assign_vif_chanctx() warn: 'arvif->vdev_type == 4' 'false' implies 'arvif->vdev_type != 4' is 'true'
drivers/net/wireless/ath/ath12k/dp_rx.c:1369 ath12k_update_per_peer_tx_stats() warn: 'mcs > 11' 'false' implies 'mcs > 11' is 'false'
drivers/net/wireless/ath/ath12k/dp_rx.c:1329 ath12k_update_per_peer_tx_stats() warn: address of 'ppdu_stats->user_stats[user]' is non-NULL

drivers/net/wireless/ath/ath12k/mac.c
    5792 
    5793         if (arvif->vdev_type == WMI_VDEV_TYPE_MONITOR) {

type checked here

    5794                 ret = ath12k_mac_monitor_start(ar);
    5795                 if (ret)
    5796                         goto out;
    5797                 arvif->is_started = true;
    5798                 goto out;
    5799         }
    5800 
    5801         ret = ath12k_mac_vdev_start(arvif, &ctx->def);
    5802         if (ret) {
    5803                 ath12k_warn(ab, "failed to start vdev %i addr %pM on freq %d: %d\n",
    5804                             arvif->vdev_id, vif->addr,
    5805                             ctx->def.chan->center_freq, ret);
    5806                 goto out;
    5807         }
    5808 
--> 5809         if (arvif->vdev_type != WMI_VDEV_TYPE_MONITOR && ar->monitor_vdev_created)
                     ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
No need to check again

    5810                 ath12k_mac_monitor_start(ar);
    5811 
    5812         arvif->is_started = true;
    5813 
    5814         /* TODO: Setup ps and cts/rts protection */
    5815 
    5816 out:
    5817         mutex_unlock(&ar->conf_mutex);
    5818 
    5819         return ret;
    5820 }

regards,
dan carpenter

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

                 reply	other threads:[~2023-02-16 14:00 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+428K5KOrDGaCw+@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