net: bareudp: simplify error paths calling dellink
Subsystems (2)
Jakub Kicinski
maintainerPATCH 1/1 net: bareudp: simplify error paths calling dellink
bareudp_dellink() only needs the device list to hand it to unregister_netdevice_queue(). We can pass NULL in, and unregister_netdevice_queue() will do the unregistering. There is no chance for batching on the error path, anyway.
--- drivers/net/bareudp.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)
drivers/net/bareudp.c +2 -6
@@ -658,7 +658,6 @@ static int bareudp_newlink(struct net *net, struct net_device *dev, struct netlink_ext_ack *extack) {struct bareudp_conf conf; -LIST_HEAD (list_kill);int err; err =bareudp2info (data, &conf, extack);
@@ -676,8 +675,7 @@ static int bareudp_newlink(struct net *net, struct net_device *dev,return 0 ; err_unconfig: -bareudp_dellink (dev, &list_kill); -unregister_netdevice_many (&list_kill); +bareudp_dellink (dev,NULL );return err; }
@@ -729,7 +727,6 @@ struct net_device *bareudp_dev_create(struct net *net, const char *name, {struct nlattr *tb[IFLA_MAX +1 ];struct net_device *dev; -LIST_HEAD (list_kill);int err;memset (tb,0 ,sizeof (tb));
@@ -753,8 +750,7 @@ struct net_device *bareudp_dev_create(struct net *net, const char *name,return dev; err: -bareudp_dellink (dev, &list_kill); -unregister_netdevice_many (&list_kill); +bareudp_dellink (dev,NULL );return ERR_PTR (err); }EXPORT_SYMBOL_GPL (bareudp_dev_create);
Signature · 1 line
2.26.2
Quoted 8 lines · Jakub Kicinski
bareudp_dellink()only needs the device list to hand it tounregister_netdevice_queue(). We can pass NULL in, andunregister_netdevice_queue()will do the unregistering. There is no chance for batching on the error path, anyway.Suggested-by Cong Wang <[email protected]>Signed-off-by Jakub Kicinski <[email protected]>
Thanks for cleaning up!
This patch was applied to netdev/net-next.git (refs/heads/master):
Hello:
This patch was applied to netdev/net-next.git (refs/heads/master):
Quoted 9 lines · On Sun, 10 Jan 2021 21:29:22 -0800 you wrote:
bareudp_dellink()only needs the device list to hand it tounregister_netdevice_queue(). We can pass NULL in, andunregister_netdevice_queue()will do the unregistering. There is no chance for batching on the error path, anyway.Suggested-by Cong Wang <[email protected]>Signed-off-by Jakub Kicinski <[email protected]>[...]
Here is the summary with links:
- [net-next] net: bareudp: simplify error paths calling dellink
https://git.kernel.org/netdev/net-next/c/1d04ccb916ce
You are awesome, thank you!
--
Deet-doot-dot, I am a bot.
https://korg.docs.kernel.org/patchwork/pwbot.html