2022-02-01 20:44:59

by Hector Martin

[permalink] [raw]
Subject: Re: [PATCH v4 3/9] brcmfmac: firmware: Do not crash on a NULL board_type

On 01/02/2022 01.49, Kalle Valo wrote:
> Andy Shevchenko <[email protected]> writes:
>
>> On Mon, Jan 31, 2022 at 6:07 PM Hector Martin <[email protected]> wrote:
>>>
>>> This unbreaks support for USB devices, which do not have a board_type
>>> to create an alt_path out of and thus were running into a NULL
>>> dereference.
>>
>> ...
>>
>>> @@ -599,6 +599,9 @@ static char *brcm_alt_fw_path(const char *path,
>>> const char *board_type)
>>> char alt_path[BRCMF_FW_NAME_LEN];
>>> char suffix[5];
>>>
>>> + if (!board_type)
>>> + return NULL;
>>
>> I still think it's better to have both callers do the same thing.
>>
>> Now it will be the double check in one case,
>
> I already applied a similar patch:
>
> https://git.kernel.org/wireless/wireless/c/665408f4c3a5
>

Feel free to drop this one from the series then, if everything else
looks good.


--
Hector Martin ([email protected])
Public Key: https://mrcn.st/pub


2022-02-02 11:10:23

by Kalle Valo

[permalink] [raw]
Subject: Re: [PATCH v4 3/9] brcmfmac: firmware: Do not crash on a NULL board_type

Hector Martin <[email protected]> writes:

> On 01/02/2022 01.49, Kalle Valo wrote:
>> Andy Shevchenko <[email protected]> writes:
>>
>>> On Mon, Jan 31, 2022 at 6:07 PM Hector Martin <[email protected]> wrote:
>>>>
>>>> This unbreaks support for USB devices, which do not have a board_type
>>>> to create an alt_path out of and thus were running into a NULL
>>>> dereference.
>>>
>>> ...
>>>
>>>> @@ -599,6 +599,9 @@ static char *brcm_alt_fw_path(const char *path,
>>>> const char *board_type)
>>>> char alt_path[BRCMF_FW_NAME_LEN];
>>>> char suffix[5];
>>>>
>>>> + if (!board_type)
>>>> + return NULL;
>>>
>>> I still think it's better to have both callers do the same thing.
>>>
>>> Now it will be the double check in one case,
>>
>> I already applied a similar patch:
>>
>> https://git.kernel.org/wireless/wireless/c/665408f4c3a5
>>
>
> Feel free to drop this one from the series then, if everything else
> looks good.

Yes, I'll drop this patch 3.

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

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