Re: [PATCH v2] wifi: brcmfmac: Fix potential kernel oops when probe fails

Arend van Spriel <[email protected]> Thu, 12 Feb 2026 07:38:18 +0100
Newsgroups dev.linux.lists.brcm80211,org.kernel.vger.linux-wireless
Message-ID <[email protected]>
Op 3 februari 2026 11:21:51 schreef Marek Szyprowski 
<[email protected]>:

> When probe of the sdio brcmfmac device fails for some reasons (i.e.
> missing firmware), the sdiodev->bus is set to error instead of NULL, thus
> the cleanup later in brcmf_sdio_remove() tries to free resources via
> invalid bus pointer. This happens because sdiodev->bus is set 2 times:
> first in brcmf_sdio_probe() and second time in brcmf_sdiod_probe(). Fix
> this by chaning the brcmf_sdio_probe() function to return the error code
> and set sdio->bus only there.
>
> Fixes: 0ff0843310b7 ("wifi: brcmfmac: Add optional lpo clock enable support")

Acked-by: Arend van Spriel<[email protected]>

> Signed-off-by: Marek Szyprowski <[email protected]>
> ---
> Changelog:
> v2:
> - changed return type of brcmf_sdio_probe() function
>
> v1: 
> https://lore.kernel.org/all/[email protected]
> ---
> drivers/net/wireless/broadcom/brcm80211/brcmfmac/bcmsdh.c | 7 +++----
> drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.c   | 7 ++++---
> drivers/net/wireless/broadcom/brcm80211/brcmfmac/sdio.h   | 2 +-
> 3 files changed, 8 insertions(+), 8 deletions(-)