Re: [PATCH] net: cpsw_new: unregister devlink on port registration failure

Andrew Lunn <[email protected]>
Newsgroups org.kernel.vger.linux-omap,org.kernel.vger.linux-kernel,org.kernel.vger.netdev
Message-ID <[email protected]>
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 <[email protected]>

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
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.