diff mbox series

[net-next] net: bareudp: simplify error paths calling dellink

Message ID 20210111052922.2145003-1-kuba@kernel.org (mailing list archive)
State Accepted
Commit 1d04ccb916ce81b8313712bae8a2304c62769c1f
Delegated to: Netdev Maintainers
Headers show
Series [net-next] net: bareudp: simplify error paths calling dellink | expand

Checks

Context Check Description
netdev/cover_letter success Link
netdev/fixes_present success Link
netdev/patch_count success Link
netdev/tree_selection success Clearly marked for net-next
netdev/subject_prefix success Link
netdev/cc_maintainers success CCed 3 of 3 maintainers
netdev/source_inline success Was 0 now: 0
netdev/verify_signedoff success Link
netdev/module_param success Was 0 now: 0
netdev/build_32bit success Errors and warnings before: 3 this patch: 3
netdev/kdoc success Errors and warnings before: 0 this patch: 0
netdev/verify_fixes success Link
netdev/checkpatch success total: 0 errors, 0 warnings, 0 checks, 32 lines checked
netdev/build_allmodconfig_warn success Errors and warnings before: 3 this patch: 3
netdev/header_inline success Link
netdev/stable success Stable not CCed

Commit Message

Jakub Kicinski Jan. 11, 2021, 5:29 a.m. UTC
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: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
---
 drivers/net/bareudp.c | 8 ++------
 1 file changed, 2 insertions(+), 6 deletions(-)

Comments

Cong Wang Jan. 11, 2021, 6:34 p.m. UTC | #1
On Sun, Jan 10, 2021 at 9:29 PM Jakub Kicinski <kuba@kernel.org> wrote:
>
> 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: Cong Wang <xiyou.wangcong@gmail.com>
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>


Reviewed-by: Cong Wang <xiyou.wangcong@gmail.com>

Thanks for cleaning up!
patchwork-bot+netdevbpf@kernel.org Jan. 12, 2021, 1:20 a.m. UTC | #2
Hello:

This patch was applied to netdev/net-next.git (refs/heads/master):

On Sun, 10 Jan 2021 21:29:22 -0800 you wrote:
> 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: Cong Wang <xiyou.wangcong@gmail.com>
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
> 
> [...]

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
diff mbox series

Patch

diff --git a/drivers/net/bareudp.c b/drivers/net/bareudp.c
index 85de5f96c02b..0965d136def3 100644
--- a/drivers/net/bareudp.c
+++ b/drivers/net/bareudp.c
@@ -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);