Re: [PATCH] brcmfmac: fix a loop exit condition

Kalle Valo
2021-06-15T13:45:31Z

Dan Carpenter <dan.carpenter@oracle.com> writes:

> On Tue, Jun 15, 2021 at 10:26:56AM +0000, Kalle Valo wrote:
>> Dan Carpenter <dan.carpenter@oracle.com> wrote:
>>
>> > This code is supposed to loop over the whole board_type[] string. The
>> > current code kind of works just because ascii values start 97 and the
>> > string is likely shorter than that so it will break when we hit the NUL
>> > terminator. But really the condition should be "i < len" instead of
>> > "i < board_type[i]".
>> >
>> > Fixes: 29e354ebeeec ("brcmfmac: Transform compatible string for FW loading")
>> > Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com>
>> > Reviewed-by: Matthias Brugger <mbrugger@suse.com>
>>
>> There was talk about v2, but I don't see it in the patchwork.
>
> Ah, crap. I started to debug Smatch to find out why it wasn't warning
> about some of these bugs and I got a bit carried away writing Smatch
> code and forgot to come back to this.
>
> I will send it tomorrow.

No worries, take your time :) I just wanted to remind about this, or see
if patchwork or the mailing list have lost patches again (which has
happened in the past).

--