linux-wireless.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Kalle Valo <kvalo@kernel.org>
To: Nathan Chancellor <nathan@kernel.org>
Cc: quic_jjohnson@quicinc.com,  morbo@google.com,
	 justinstitt@google.com, quic_periyasa@quicinc.com,
	 ath12k@lists.infradead.org, linux-wireless@vger.kernel.org,
	 llvm@lists.linux.dev, patches@lists.linux.dev
Subject: Re: [PATCH] wifi: ath12k: Fix uninitialized use of ret in ath12k_mac_allocate()
Date: Wed, 21 Feb 2024 20:21:02 +0200	[thread overview]
Message-ID: <87ttm1llv5.fsf@kernel.org> (raw)
In-Reply-To: <20240221180013.GA2074929@dev-arch.thelio-3990X> (Nathan Chancellor's message of "Wed, 21 Feb 2024 11:00:13 -0700")

Nathan Chancellor <nathan@kernel.org> writes:

> Hi Kalle,
>
> On Wed, Feb 07, 2024 at 03:08:14PM +0000, Kalle Valo wrote:
>> Nathan Chancellor <nathan@kernel.org> wrote:
>> 
>> > Clang warns (or errors with CONFIG_WERROR=y):
>> > 
>> >   drivers/net/wireless/ath/ath12k/mac.c:8060:9: error: variable 'ret' is uninitialized when used here [-Werror,-Wuninitialized]
>> >    8060 |         return ret;
>> >         |                ^~~
>> >   drivers/net/wireless/ath/ath12k/mac.c:8022:9: note: initialize
>> > the variable 'ret' to silence this warning
>> >    8022 |         int ret, i, j;
>> >         |                ^
>> >         |                 = 0
>> >   1 error generated.
>> > 
>> > Commit 6db6e70a17f6 ("wifi: ath12k: Introduce the container for mac80211
>> > hw") added a completely uninitialized use of ret. Prior to that change,
>> > -ENOMEM was returned to the callers of ath12k_mac_allocate() whenever
>> > ath12k_mac_hw_allocate() failed. Assign that value to ret to make sure
>> > it is always initialized when used and clear up the warning.
>> > 
>> > Closes: https://github.com/ClangBuiltLinux/linux/issues/1989i
>> > Fixes: 6db6e70a17f6 ("wifi: ath12k: Introduce the container for mac80211 hw")
>> > Signed-off-by: Nathan Chancellor <nathan@kernel.org>
>> > Acked-by: Jeff Johnson <quic_jjohnson@quicinc.com>
>> > Signed-off-by: Kalle Valo <quic_kvalo@quicinc.com>
>> 
>> Patch applied to ath-next branch of ath.git, thanks.
>> 
>> 04edb5dc68f4 wifi: ath12k: Fix uninitialized use of ret in ath12k_mac_allocate()
>
> It doesn't seem like this tree or branch flows into -next on its own, so
> this patch is not present in and the build still breaks on
> next-20240221. Can this be fixed so that this warning stops breaking our
> builds?

Yeah, ath-next is not pulled to linux-next because of "reasons". We are
planning to send ath-next pull request to wireless-next in the next few
days.

-- 
https://patchwork.kernel.org/project/linux-wireless/list/

https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches

      reply	other threads:[~2024-02-21 18:21 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-02-05 19:49 [PATCH] wifi: ath12k: Fix uninitialized use of ret in ath12k_mac_allocate() Nathan Chancellor
2024-02-05 20:50 ` Jeff Johnson
2024-02-07 15:08 ` Kalle Valo
2024-02-21 18:00   ` Nathan Chancellor
2024-02-21 18:21     ` Kalle Valo [this message]

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=87ttm1llv5.fsf@kernel.org \
    --to=kvalo@kernel.org \
    --cc=ath12k@lists.infradead.org \
    --cc=justinstitt@google.com \
    --cc=linux-wireless@vger.kernel.org \
    --cc=llvm@lists.linux.dev \
    --cc=morbo@google.com \
    --cc=nathan@kernel.org \
    --cc=patches@lists.linux.dev \
    --cc=quic_jjohnson@quicinc.com \
    --cc=quic_periyasa@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;
as well as URLs for NNTP newsgroup(s).