[PATCH net] net: airoha: Move net_devs registration in a dedicated routine

Simon Horman horms at kernel.org
Mon Dec 15 06:11:51 PST 2025


On Sun, Dec 14, 2025 at 10:30:07AM +0100, Lorenzo Bianconi wrote:
> Since airoha_probe() is not executed under rtnl lock, there is small race
> where a given device is configured by user-space while the remaining ones
> are not completely loaded from the dts yet. This condition will allow a
> hw device misconfiguration since there are some conditions (e.g. GDM2 check
> in airoha_dev_init()) that require all device are properly loaded from the
> device tree. Fix the issue moving net_devices registration at the end of
> the airoha_probe routine.
> 
> Fixes: 9cd451d414f6e ("net: airoha: Add loopback support for GDM2")
> Signed-off-by: Lorenzo Bianconi <lorenzo at kernel.org>

Hi Lorenzo,

As a fix this patch looks good to me.

Reviewed-by: Simon Horman <horms at kernel.org>

But I am somewhat surprised that the netdev isn't unregistered earlier
both in airoha_remove() and the unwind ladder of airoha_probe().



More information about the Linux-mediatek mailing list