Commit b133be60 authored by Eric Dumazet's avatar Eric Dumazet Committed by Greg Kroah-Hartman

net: l2tp_eth: fix kernel panic on rmmod l2tp_eth

[ Upstream commit a06998b8 ]

We must prevent module unloading if some devices are still attached to
l2tp_eth driver.
Signed-off-by: default avatarEric Dumazet <edumazet@google.com>
Reported-by: default avatarDenys Fedoryshchenko <denys@visp.net.lb>
Tested-by: default avatarDenys Fedoryshchenko <denys@visp.net.lb>
Cc: James Chapman <jchapman@katalix.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 89a5feb2
......@@ -167,6 +167,7 @@ static void l2tp_eth_delete(struct l2tp_session *session)
if (dev) {
unregister_netdev(dev);
spriv->dev = NULL;
module_put(THIS_MODULE);
}
}
}
......@@ -254,6 +255,7 @@ static int l2tp_eth_create(struct net *net, u32 tunnel_id, u32 session_id, u32 p
if (rc < 0)
goto out_del_dev;
__module_get(THIS_MODULE);
/* Must be done after register_netdev() */
strlcpy(session->ifname, dev->name, IFNAMSIZ);
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment