Skip to content

Commit

Permalink
netdevsim: let net core to free netdevsim netdev
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Jiri Pirko authored and David S. Miller committed Apr 9, 2019
1 parent 7d1df2c commit c3d9a43
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/net/netdevsim/netdev.c
Original file line number Diff line number Diff line change
Expand Up @@ -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 = {
Expand Down Expand Up @@ -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;
Expand Down

0 comments on commit c3d9a43

Please sign in to comment.