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? Dmitry