From: Kalle Valo <kvalo@kernel.org>
To: Nathan Chancellor <nathan@kernel.org>
Cc: Ping-Ke Shih <pkshih@realtek.com>,
tony0620emma@gmail.com, linux-wireless@vger.kernel.org
Subject: Re: [PATCH] wifi: rtw88: fix uninitialized use of primary channel index
Date: Mon, 29 Aug 2022 18:35:39 +0300 [thread overview]
Message-ID: <87o7w3f4fo.fsf@kernel.org> (raw)
In-Reply-To: <YwZ+RsHL+n02gHZx@dev-arch.thelio-3990X> (Nathan Chancellor's message of "Wed, 24 Aug 2022 12:38:46 -0700")
Nathan Chancellor <nathan@kernel.org> writes:
> On Mon, Aug 15, 2022 at 02:20:04PM +0800, Ping-Ke Shih wrote:
>
>> clang reports uninitialized use:
>>
>> >> drivers/net/wireless/realtek/rtw88/main.c:731:2: warning: variable
>> 'primary_channel_idx' is used uninitialized whenever switch default is
>> taken [-Wsometimes-uninitialized]
>> default:
>> ^~~~~~~
>> drivers/net/wireless/realtek/rtw88/main.c:754:39: note: uninitialized
>> use occurs here
>> hal->current_primary_channel_index = primary_channel_idx;
>> ^~~~~~~~~~~~~~~~~~~
>> drivers/net/wireless/realtek/rtw88/main.c:687:24: note: initialize the
>> variable 'primary_channel_idx' to silence this warning
>> u8 primary_channel_idx;
>> ^
>> = '\0'
>>
>> This situation could not happen, because possible channel bandwidth
>> 20/40/80MHz are enumerated.
>>
>> Fixes: 341dd1f7de4c ("wifi: rtw88: add the update channel flow to support setting by parameters")
>> Reported-by: kernel test robot <lkp@intel.com>
>> Signed-off-by: Ping-Ke Shih <pkshih@realtek.com>
>
> Reviewed-by: Nathan Chancellor <nathan@kernel.org>
>
> Can we get this into -next soon? This warning is breaking our builds due
> to CONFIG_WERROR.
Johannes applied it:
https://git.kernel.org/netdev/net-next/c/4ffb4d25ef12
--
https://patchwork.kernel.org/project/linux-wireless/list/
https://wireless.wiki.kernel.org/en/developers/documentation/submittingpatches
prev parent reply other threads:[~2022-08-29 15:35 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2022-08-15 6:20 [PATCH] wifi: rtw88: fix uninitialized use of primary channel index Ping-Ke Shih
2022-08-24 19:38 ` Nathan Chancellor
2022-08-29 15:35 ` 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=87o7w3f4fo.fsf@kernel.org \
--to=kvalo@kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=nathan@kernel.org \
--cc=pkshih@realtek.com \
--cc=tony0620emma@gmail.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).