From: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
To: Bart Van Assche <bvanassche@acm.org>,
Peter Zijlstra <peterz@infradead.org>
Cc: Will Deacon <will@kernel.org>, Christoph Hellwig <hch@lst.de>,
Greg Kroah-Hartman <gregkh@linuxfoundation.org>,
Marco Elver <elver@google.com>,
Nick Desaulniers <ndesaulniers@google.com>,
Nathan Chancellor <nathan@kernel.org>,
Kees Cook <kees@kernel.org>, Jann Horn <jannh@google.com>,
linux-kernel@vger.kernel.org,
Karthikeyan Periyasamy <quic_periyasa@quicinc.com>,
linux-wireless <linux-wireless@vger.kernel.org>,
"ath12k@lists.infradead.org" <ath12k@lists.infradead.org>
Subject: Re: [PATCH RFC 25/33] wifi: ath12k: Fix locking in error paths
Date: Thu, 6 Feb 2025 10:25:13 -0800 [thread overview]
Message-ID: <7633c19b-2aab-4f2a-8c11-27425f7299ae@oss.qualcomm.com> (raw)
In-Reply-To: <20250206175114.1974171-26-bvanassche@acm.org>
On 2/6/2025 9:51 AM, Bart Van Assche wrote:
> If ag->mutex has been locked, unlock it before returning. If it has not
> been locked, do not unlock it before returning. These bugs have been
> detected by the Clang thread-safety analyzer.
>
> Cc: Karthikeyan Periyasamy <quic_periyasa@quicinc.com>
> Cc: Jeff Johnson <jeff.johnson@oss.qualcomm.com>
> Fixes: ee146e11b4d9 ("wifi: ath12k: refactor core start based on hardware group")
> Signed-off-by: Bart Van Assche <bvanassche@acm.org>
> ---
> drivers/net/wireless/ath/ath12k/core.c | 4 +++-
> 1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/drivers/net/wireless/ath/ath12k/core.c b/drivers/net/wireless/ath/ath12k/core.c
> index 0606116d6b9c..212cd935e60a 100644
> --- a/drivers/net/wireless/ath/ath12k/core.c
> +++ b/drivers/net/wireless/ath/ath12k/core.c
> @@ -1122,16 +1122,18 @@ int ath12k_core_qmi_firmware_ready(struct ath12k_base *ab)
> ath12k_core_stop(ab);
> mutex_unlock(&ab->core_lock);
> }
> + mutex_unlock(&ag->mutex);
> goto exit;
>
> err_dp_free:
> ath12k_dp_free(ab);
> mutex_unlock(&ab->core_lock);
> + mutex_unlock(&ag->mutex);
> +
> err_firmware_stop:
> ath12k_qmi_firmware_stop(ab);
>
> exit:
> - mutex_unlock(&ag->mutex);
> return ret;
> }
>
This looks like a legitimate issue.
Can you submit this as a single patch and cc the ath12k and linux-wireless
lists (as I've done in this reply)
next parent reply other threads:[~2025-02-06 19:01 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
[not found] <20250206175114.1974171-1-bvanassche@acm.org>
[not found] ` <20250206175114.1974171-26-bvanassche@acm.org>
2025-02-06 18:25 ` Jeff Johnson [this message]
2025-02-06 22:13 ` [PATCH RFC 25/33] wifi: ath12k: Fix locking in error paths Bart Van Assche
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=7633c19b-2aab-4f2a-8c11-27425f7299ae@oss.qualcomm.com \
--to=jeff.johnson@oss.qualcomm.com \
--cc=ath12k@lists.infradead.org \
--cc=bvanassche@acm.org \
--cc=elver@google.com \
--cc=gregkh@linuxfoundation.org \
--cc=hch@lst.de \
--cc=jannh@google.com \
--cc=kees@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=nathan@kernel.org \
--cc=ndesaulniers@google.com \
--cc=peterz@infradead.org \
--cc=quic_periyasa@quicinc.com \
--cc=will@kernel.org \
/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