Commit c3d9a435 authored by Jiri Pirko's avatar Jiri Pirko Committed by David S. Miller

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: default avatarJiri Pirko <jiri@mellanox.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 7d1df2c9
...@@ -139,7 +139,6 @@ static void nsim_dev_release(struct device *dev) ...@@ -139,7 +139,6 @@ static void nsim_dev_release(struct device *dev)
struct netdevsim *ns = to_nsim(dev); struct netdevsim *ns = to_nsim(dev);
nsim_vfs_disable(ns); nsim_vfs_disable(ns);
free_netdev(ns->netdev);
} }
static struct device_type nsim_dev_type = { static struct device_type nsim_dev_type = {
...@@ -490,6 +489,7 @@ static void nsim_setup(struct net_device *dev) ...@@ -490,6 +489,7 @@ static void nsim_setup(struct net_device *dev)
eth_hw_addr_random(dev); eth_hw_addr_random(dev);
dev->netdev_ops = &nsim_netdev_ops; dev->netdev_ops = &nsim_netdev_ops;
dev->needs_free_netdev = true;
dev->priv_destructor = nsim_free; dev->priv_destructor = nsim_free;
dev->tx_queue_len = 0; dev->tx_queue_len = 0;
......
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