From: Jiri Pirko <jiri@resnulli.us>
To: netdev@vger.kernel.org
Cc: davem@davemloft.net, mlxsw@mellanox.com, jakub.kicinski@netronome.com
Subject: [patch net-next 2/3] netdevsim: let net core to free netdevsim netdev
Date: Tue, 9 Apr 2019 17:14:53 +0200 [thread overview]
Message-ID: <20190409151454.14097-3-jiri@resnulli.us> (raw)
In-Reply-To: <20190409151454.14097-1-jiri@resnulli.us>
From: Jiri Pirko <jiri@mellanox.com>
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>
---
drivers/net/netdevsim/netdev.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
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;
--
2.17.2
next prev parent reply other threads:[~2019-04-09 15:15 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2019-04-09 15:14 [patch net-next 0/3] netdevsim: small spring cleanup Jiri Pirko
2019-04-09 15:14 ` [patch net-next 1/3] netdevsim: remove nsim_dellink() implementation Jiri Pirko
2019-04-09 15:14 ` Jiri Pirko [this message]
2019-04-09 15:14 ` [patch net-next 3/3] netdevsim: assume CONFIG_NET_DEVLINK is always enabled Jiri Pirko
2019-04-09 16:57 ` [patch net-next 0/3] netdevsim: small spring cleanup Jakub Kicinski
2019-04-09 18:18 ` David Miller
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20190409151454.14097-3-jiri@resnulli.us \
--to=jiri@resnulli.us \
--cc=davem@davemloft.net \
--cc=jakub.kicinski@netronome.com \
--cc=mlxsw@mellanox.com \
--cc=netdev@vger.kernel.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).