Re: [PATCH] net: cpsw_new: unregister devlink on port registration failure
From: Andrew Lunn
Date: Wed Jun 03 2026 - 12:17:40 EST
On Wed, Jun 03, 2026 at 10:07:42PM +0800, Guangshuo Li wrote:
> cpsw_probe() registers devlink before registering the CPSW ports.
>
> If cpsw_register_ports() fails, the error path only unregisters the
> notifiers and then releases the lower level resources. It does not undo
> the successful cpsw_register_devlink() call, leaving the devlink instance
> and its parameters registered after probe has failed.
>
> Add a devlink cleanup label for the path where devlink registration has
> already succeeded, and use it when port registration fails.
>
> Fixes: ed3525eda4c4 ("net: ethernet: ti: introduce cpsw switchdev based driver part 1 - dual-emac")
> Signed-off-by: Guangshuo Li <lgs201920130244@xxxxxxxxx>
https://www.kernel.org/doc/html/latest/process/maintainer-netdev.html
Please set the subject line correctly.
https://www.kernel.org/doc/html/latest/process/stable-kernel-rules.html
Does this bother people? If not, net-next, and no Fixes tag please.
Andrew
---
pw-bot: cr