Commit 1d04ccb9 authored by Jakub Kicinski's avatar Jakub Kicinski

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.
Suggested-by: default avatarCong Wang <xiyou.wangcong@gmail.com>
Reviewed-by: default avatarCong Wang <xiyou.wangcong@gmail.com>
Link: https://lore.kernel.org/r/20210111052922.2145003-1-kuba@kernel.orgSigned-off-by: default avatarJakub Kicinski <kuba@kernel.org>
parent 101c59b8
...@@ -658,7 +658,6 @@ static int bareudp_newlink(struct net *net, struct net_device *dev, ...@@ -658,7 +658,6 @@ static int bareudp_newlink(struct net *net, struct net_device *dev,
struct netlink_ext_ack *extack) struct netlink_ext_ack *extack)
{ {
struct bareudp_conf conf; struct bareudp_conf conf;
LIST_HEAD(list_kill);
int err; int err;
err = bareudp2info(data, &conf, extack); err = bareudp2info(data, &conf, extack);
...@@ -676,8 +675,7 @@ static int bareudp_newlink(struct net *net, struct net_device *dev, ...@@ -676,8 +675,7 @@ static int bareudp_newlink(struct net *net, struct net_device *dev,
return 0; return 0;
err_unconfig: err_unconfig:
bareudp_dellink(dev, &list_kill); bareudp_dellink(dev, NULL);
unregister_netdevice_many(&list_kill);
return err; return err;
} }
...@@ -729,7 +727,6 @@ struct net_device *bareudp_dev_create(struct net *net, const char *name, ...@@ -729,7 +727,6 @@ struct net_device *bareudp_dev_create(struct net *net, const char *name,
{ {
struct nlattr *tb[IFLA_MAX + 1]; struct nlattr *tb[IFLA_MAX + 1];
struct net_device *dev; struct net_device *dev;
LIST_HEAD(list_kill);
int err; int err;
memset(tb, 0, sizeof(tb)); memset(tb, 0, sizeof(tb));
...@@ -753,8 +750,7 @@ struct net_device *bareudp_dev_create(struct net *net, const char *name, ...@@ -753,8 +750,7 @@ struct net_device *bareudp_dev_create(struct net *net, const char *name,
return dev; return dev;
err: err:
bareudp_dellink(dev, &list_kill); bareudp_dellink(dev, NULL);
unregister_netdevice_many(&list_kill);
return ERR_PTR(err); return ERR_PTR(err);
} }
EXPORT_SYMBOL_GPL(bareudp_dev_create); EXPORT_SYMBOL_GPL(bareudp_dev_create);
......
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