Thread (4 messages) flat view 4 messages, 2 authors, 2021-10-26
STALE1756d

[PATCH net-next 2/2] net: dsa: stop calling dev_hold in dsa_slave_fdb_event

From: Vladimir Oltean <vladimir.oltean@nxp.com>
Date: 2021-10-26 09:26:52
Subsystem: networking [dsa], networking [general], the rest · Maintainers: Andrew Lunn, Vladimir Oltean, "David S. Miller", Eric Dumazet, Jakub Kicinski, Paolo Abeni, Linus Torvalds

Now that we guarantee that SWITCHDEV_FDB_{ADD,DEL}_TO_DEVICE events have
finished executing by the time we leave our bridge upper interface,
we've established a stronger boundary condition for how long the
dsa_slave_switchdev_event_work() might run.

As such, it is no longer possible for DSA slave interfaces to become
unregistered, since they are still bridge ports.

So delete the unnecessary dev_hold() and dev_put().

Signed-off-by: Vladimir Oltean <vladimir.oltean@nxp.com>
---
 net/dsa/slave.c | 3 ---
 1 file changed, 3 deletions(-)
diff --git a/net/dsa/slave.c b/net/dsa/slave.c
index adcfb2cb4e61..dbda0e0fbffa 100644
--- a/net/dsa/slave.c
+++ b/net/dsa/slave.c
@@ -2448,7 +2448,6 @@ static void dsa_slave_switchdev_event_work(struct work_struct *work)
 		break;
 	}
 
-	dev_put(switchdev_work->dev);
 	kfree(switchdev_work);
 }
 
@@ -2521,8 +2520,6 @@ static int dsa_slave_fdb_event(struct net_device *dev,
 	switchdev_work->vid = fdb_info->vid;
 	switchdev_work->host_addr = host_addr;
 
-	/* Hold a reference for dsa_fdb_offload_notify */
-	dev_hold(dev);
 	dsa_schedule_work(&switchdev_work->work);
 
 	return 0;
-- 
2.25.1
Keyboard shortcuts
hback out one level
jnext message in thread
kprevious message in thread
ldrill in
Escclose help / fold thread tree
?toggle this help