lkml.org 
[lkml]   [2022]   [Jan]   [31]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
From
Date
SubjectRe: [PATCH v4 3/9] brcmfmac: firmware: Do not crash on a NULL board_type
On Mon, Jan 31, 2022 at 6:07 PM Hector Martin <marcan@marcan.st> 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,

--
With Best Regards,
Andy Shevchenko

\
 
 \ /
  Last update: 2022-01-31 17:31    [W:0.185 / U:0.032 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site