aboutsummaryrefslogtreecommitdiff
path: root/drivers/net/netdevsim
diff options
context:
space:
mode:
authorJiri Pirko2019-04-09 17:14:53 +0200
committerDavid S. Miller2019-04-09 11:16:59 -0700
commitc3d9a435d9398294231cc398173780bae951d60f (patch)
tree69f54ebbae2eeeb25d666d66711c6a82d3bbbc38 /drivers/net/netdevsim
parent7d1df2c978dc472bc514f92c9ecb1db33503b298 (diff)
netdevsim: let net core to free netdevsim netdev
No need to free it ourselves, just set the "needs_free_netdev" flag and leave the work to net core. Signed-off-by: Jiri Pirko <jiri@mellanox.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/netdevsim')
-rw-r--r--drivers/net/netdevsim/netdev.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/net/netdevsim/netdev.c b/drivers/net/netdevsim/netdev.c
index cc4a5b5793fa..0af38bc6d98c 100644
--- a/drivers/net/netdevsim/netdev.c
+++ b/drivers/net/netdevsim/netdev.c
@@ -139,7 +139,6 @@ static void nsim_dev_release(struct device *dev)
struct netdevsim *ns = to_nsim(dev);
nsim_vfs_disable(ns);
- free_netdev(ns->netdev);
}
static struct device_type nsim_dev_type = {
@@ -490,6 +489,7 @@ static void nsim_setup(struct net_device *dev)
eth_hw_addr_random(dev);
dev->netdev_ops = &nsim_netdev_ops;
+ dev->needs_free_netdev = true;
dev->priv_destructor = nsim_free;
dev->tx_queue_len = 0;