Re: [PATCH] net: dsa: loop: release netdev reference on registration failure

From
Andrew Lunn <andrew@lunn.ch>
Date
2026-11-03 13:36:20
Also in
lkml, stable
Reply to
Wentao Liang, 2026-11-03
On Tue, Nov 03, 2026 at 10:05:29AM +0000, Wentao Liang wrote:
dsa_loop_drv_probe() takes a reference on the CPU net_device with
dev_get_by_name() before calling dsa_register_switch(). The matching
dev_put() is only done in dsa_loop_drv_remove(), which the driver core
does not call after a failed probe, so every failed registration leaks
the reference.
Please read:

https://www.kernel.org/doc/html/latest/process/maintainer-netdev.html

You must indicate which tree this is for.

And please think carefully about which tree you pick. Does the issue
actually bother anybody?

    Andrew

---
pw-bot: cr
Thread (4 messages) 4 messages, 4 authors, last reply 2d ago
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help