lkml.org 
[lkml]   [2019]   [May]   [23]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
SubjectRe: [PATCH] rsi: Properly initialize data in rsi_sdio_ta_reset
Date
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

\
 
 \ /
  Last update: 2019-05-23 10:57    [W:0.093 / U:0.508 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site