[lvc-project] [PATCH] wifi: brcmfmac: avoid calling platform_driver_unregister() more than once

Arend Van Spriel arend.vanspriel at broadcom.com
Wed Jul 23 11:39:05 MSK 2025


On Mon, Apr 14, 2025 at 11:56 AM Dmitry Antipov <dmantipov at yandex.ru> wrote:
>
> On 4/14/25 12:22 PM, Arend van Spriel wrote:
>
> > When the platform_driver_probe() fails it means that brcmfmac_pdata will be NULL
>
> Hm.
>
> platform_driver_register()
>   -> probe (which is brcmf_common_pd_probe())
>      ...
>      brcmfmac_pdata = dev_get_platdata(&pdev->dev);
>      ...
>   ...
>   if (!bus_for_each_dev(&platform_bus_type, NULL, &drv->driver, is_bound_to_driver)) {
>           retval = -ENODEV;
>           platform_driver_unregister(drv); [1]
>   }
>
> If we hit platform_driver_unregister() at [1], 'brcmfmac_pdata' is not NULL and,
> if something goes wrong in brcmf_core_init() next,  platform_driver_unregister()
> may be called again.
>
> Shouldn't 'brcmf_common_pd_remove()' reset 'brcmfmac_data' back to NULL?

Hi Dmitry,

This one may have gone stale a bit. It showed up on my patchwork todo
list which we setup last week. I agree that reset brcmfmac_data to
NULL is needed.

Regards,
Arend
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 4206 bytes
Desc: S/MIME Cryptographic Signature
URL: <http://linuxtesting.org/pipermail/lvc-project/attachments/20250723/55eb23b8/attachment.bin>


More information about the lvc-project mailing list