All of lore.kernel.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: driver for Qualcomm Wi-Fi 7 devices
Date: Thu, 16 Feb 2023 15:28:49 +0300	[thread overview]
Message-ID: <Y+4hgdh7iTOPFiyk@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:5872 ath12k_mac_op_unassign_vif_chanctx()
	error: double unlocked '&ar->conf_mutex' (orig line 5854)

drivers/net/wireless/ath/ath12k/mac.c
    5822 static void
    5823 ath12k_mac_op_unassign_vif_chanctx(struct ieee80211_hw *hw,
    5824                                    struct ieee80211_vif *vif,
    5825                                    struct ieee80211_bss_conf *link_conf,
    5826                                    struct ieee80211_chanctx_conf *ctx)
    5827 {
    5828         struct ath12k *ar = hw->priv;
    5829         struct ath12k_base *ab = ar->ab;
    5830         struct ath12k_vif *arvif = (void *)vif->drv_priv;
    5831         int ret;
    5832 
    5833         mutex_lock(&ar->conf_mutex);
    5834 
    5835         ath12k_dbg(ab, ATH12K_DBG_MAC,
    5836                    "mac chanctx unassign ptr %pK vdev_id %i\n",
    5837                    ctx, arvif->vdev_id);
    5838 
    5839         WARN_ON(!arvif->is_started);
    5840 
    5841         if (ab->hw_params->vdev_start_delay &&
    5842             arvif->vdev_type == WMI_VDEV_TYPE_MONITOR &&
    5843             ath12k_peer_find_by_addr(ab, ar->mac_addr))
    5844                 ath12k_peer_delete(ar, arvif->vdev_id, ar->mac_addr);
    5845 
    5846         if (arvif->vdev_type == WMI_VDEV_TYPE_MONITOR) {
    5847                 ret = ath12k_mac_monitor_stop(ar);
    5848                 if (ret) {
    5849                         mutex_unlock(&ar->conf_mutex);
    5850                         return;
    5851                 }
    5852 
    5853                 arvif->is_started = false;
    5854                 mutex_unlock(&ar->conf_mutex);

Should this return after unlocking?

    5855         }
    5856 
    5857         ret = ath12k_mac_vdev_stop(arvif);
    5858         if (ret)
    5859                 ath12k_warn(ab, "failed to stop vdev %i: %d\n",
    5860                             arvif->vdev_id, ret);
    5861 
    5862         arvif->is_started = false;
    5863 
    5864         if (ab->hw_params->vdev_start_delay &&
    5865             arvif->vdev_type == WMI_VDEV_TYPE_MONITOR)
    5866                 ath12k_wmi_vdev_down(ar, arvif->vdev_id);
    5867 
    5868         if (arvif->vdev_type != WMI_VDEV_TYPE_MONITOR &&
    5869             ar->num_started_vdevs == 1 && ar->monitor_vdev_created)
    5870                 ath12k_mac_monitor_stop(ar);
    5871 
--> 5872         mutex_unlock(&ar->conf_mutex);
                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

    5873 }

regards,
dan carpenter

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

             reply	other threads:[~2023-02-16 12:29 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2023-02-16 12:28 Dan Carpenter [this message]
  -- strict thread matches above, loose matches on Subject: below --
2024-06-14 17:33 [bug report] wifi: ath12k: driver for Qualcomm Wi-Fi 7 devices Dan Carpenter
2023-02-16 11:54 Dan Carpenter
2023-02-16 11:44 Dan Carpenter
2023-02-16  9:57 Dan Carpenter

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+4hgdh7iTOPFiyk@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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.