From: Kalle Valo <kvalo@codeaurora.org>
To: Arnd Bergmann <arnd@arndb.de>
Cc: Nathan Chancellor <natechancellor@gmail.com>,
Nick Desaulniers <ndesaulniers@google.com>,
Amitkumar Karwar <amitkarwar@gmail.com>,
Siva Rebbagondla <siva8118@gmail.com>,
linux-wireless <linux-wireless@vger.kernel.org>,
Networking <netdev@vger.kernel.org>,
LKML <linux-kernel@vger.kernel.org>,
clang-built-linux <clang-built-linux@googlegroups.com>
Subject: Re: [PATCH] rsi: Properly initialize data in rsi_sdio_ta_reset
Date: Thu, 23 May 2019 11:56:42 +0300 [thread overview]
Message-ID: <87mujdo8fp.fsf@codeaurora.org> (raw)
In-Reply-To: <CAK8P3a001V5qQo4vGfpugtmrnFfUNeP_q4KY-YS7rP_L91HY1A@mail.gmail.com> (Arnd Bergmann's message of "Thu, 23 May 2019 10:51:01 +0200")
Arnd Bergmann <arnd@arndb.de> writes:
>> > @@ -937,7 +937,7 @@ static int rsi_sdio_ta_reset(struct rsi_hw *adapter)
>> > }
>> >
>> > rsi_dbg(INIT_ZONE, "%s: Bring TA out of reset\n", __func__);
>> > - put_unaligned_le32(TA_HOLD_THREAD_VALUE, data);
>> > + put_unaligned_le32(TA_HOLD_THREAD_VALUE, &data);
>> > addr = TA_HOLD_THREAD_REG | RSI_SD_REQUEST_MASTER;
>> > status = rsi_sdio_write_register_multiple(adapter, addr,
>> > (u8 *)&data,
>
> This is clearly not ok, as put_unaligned_le32() stores four bytes, and
> the local variable is only one byte!
>
> Also, sdio does use DMA for transfers, so the variable has to be
> dynamically allocated. I think your original patch was correct.
> The only change I'd possibly make would be to use
> RSI_9116_REG_SIZE instead of sizeof(u32).
Good point. Nathan please fix this and submit v2.
>> Did any of the maintainers have any comments on what the correct
>> solution is here to resolve this warning? It is one of the few left
>> before we can turn on -Wuninitialized for the whole kernel.
>
> I would argue that this should not stop us from turning it on, as the
> warning is for a clear bug in the code that absolutely needs to be
> fixed, rather than a false-positive.
I can queue v2 for v5.2, just remind me by adding "[PATCH v2 5.2]" to
the subject.
--
Kalle Valo
next prev parent reply other threads:[~2019-05-23 8:56 UTC|newest]
Thread overview: 11+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-05-02 15:15 [PATCH] rsi: Properly initialize data in rsi_sdio_ta_reset Nathan Chancellor
2019-05-02 18:18 ` Nick Desaulniers
2019-05-03 3:17 ` Nathan Chancellor
2019-05-23 1:54 ` Nathan Chancellor
2019-05-23 8:51 ` Arnd Bergmann
2019-05-23 8:56 ` Kalle Valo [this message]
2019-05-23 8:52 ` Kalle Valo
2019-05-03 4:38 ` Kalle Valo
2019-05-06 20:51 ` Nathan Chancellor
2019-05-23 15:30 ` [PATCH v2 5.2] " Nathan Chancellor
2019-05-28 11:33 ` Kalle Valo
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=87mujdo8fp.fsf@codeaurora.org \
--to=kvalo@codeaurora.org \
--cc=amitkarwar@gmail.com \
--cc=arnd@arndb.de \
--cc=clang-built-linux@googlegroups.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-wireless@vger.kernel.org \
--cc=natechancellor@gmail.com \
--cc=ndesaulniers@google.com \
--cc=netdev@vger.kernel.org \
--cc=siva8118@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).