summaryrefslogtreecommitdiff
path: root/drivers/net/slip/slip.c
diff options
context:
space:
mode:
authorGreg Kroah-Hartman <gregkh@linuxfoundation.org>2026-09-07 17:23:00 +0200
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2026-09-07 17:23:00 +0200
commitdcf5b8a7ae4e3875878529597c05f8cac4121515 (patch)
tree0d86567a8feacb35b2a62c1ba6cf6c2fe3be65de /drivers/net/slip/slip.c
parent864c971e923f55d3ff5ac3ebc87aab8108d30c8a (diff)
parent7cfc41f8e80f11ffa8382ed1a505154ceffb79c7 (diff)
Merge v6.18.50linux-rolling-lts
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
Diffstat (limited to 'drivers/net/slip/slip.c')
-rw-r--r--drivers/net/slip/slip.c11
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/net/slip/slip.c b/drivers/net/slip/slip.c
index bc84e2cc0502..59daf095cad6 100644
--- a/drivers/net/slip/slip.c
+++ b/drivers/net/slip/slip.c
@@ -628,9 +628,15 @@ static void sl_uninit(struct net_device *dev)
struct slip *sl = netdev_priv(dev);
sl_free_bufs(sl);
+ /* Drop the slip_devs[] entry here rather than from the destructor:
+ * ndo_uninit runs under RTNL, so it cannot race sl_sync().
+ */
+ slip_devs[dev->base_addr] = NULL;
}
-/* Hook the destructor so we can free slip devices at the right point in time */
+/* Only for the slip_open() error path: register_netdevice() can fail before
+ * ndo_init, and then ndo_uninit is not called either.
+ */
static void sl_free_netdev(struct net_device *dev)
{
int i = dev->base_addr;
@@ -657,7 +663,6 @@ static void sl_setup(struct net_device *dev)
{
dev->netdev_ops = &sl_netdev_ops;
dev->needs_free_netdev = true;
- dev->priv_destructor = sl_free_netdev;
dev->hard_header_len = 0;
dev->addr_len = 0;
@@ -908,7 +913,7 @@ static void slip_close(struct tty_struct *tty)
#endif
/* Flush network side */
unregister_netdev(sl->dev);
- /* This will complete via sl_free_netdev */
+ /* sl_uninit() has dropped the slip_devs[] entry by now */
}
static void slip_hangup(struct tty_struct *tty)