public inbox for ath12k@lists.infradead.org
 help / color / mirror / Atom feed
* [bug report] wifi: ath12k: duplicate checks
@ 2023-02-16 14:00 Dan Carpenter
  0 siblings, 0 replies; only message in thread
From: Dan Carpenter @ 2023-02-16 14:00 UTC (permalink / raw)
  To: quic_kvalo; +Cc: ath12k

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

^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2023-02-16 14:00 UTC | newest]

Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-02-16 14:00 [bug report] wifi: ath12k: duplicate checks Dan Carpenter

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox