lkml.org 
[lkml]   [2022]   [Nov]   [2]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
Patch in this message
/
Date
From
Subject[PATCH linux-next] net: af key: remove redundant ret variable
From a09ddf4bd144610fd17bdbf07f0c27700d805e6f Mon Sep 17 00:00:00 2001
From: zhang songyi <zhang.songyi@zte.com.cn>
Date: Wed, 2 Nov 2022 21:05:39 +0800
Subject: [PATCH linux-next] net: af_key: remove redundant ret variable

Return value from pfkey_net_init() directly instead of taking this in
another redundant variable.

Reported-by: Zeal Robot <zealci@zte.com.cn>
Signed-off-by: zhang songyi <zhang.songyi@zte.com.cn>
---
net/key/af_key.c | 5 +----
1 file changed, 1 insertion(+), 4 deletions(-)

diff --git a/net/key/af_key.c b/net/key/af_key.c
index 213287814328..ec37825b1c15 100644
--- a/net/key/af_key.c
+++ b/net/key/af_key.c
@@ -3863,14 +3863,11 @@ static struct xfrm_mgr pfkeyv2_mgr =
static int __net_init pfkey_net_init(struct net *net)
{
struct netns_pfkey *net_pfkey = net_generic(net, pfkey_net_id);
- int rv;

INIT_HLIST_HEAD(&net_pfkey->table);
atomic_set(&net_pfkey->socks_nr, 0);

- rv = pfkey_init_proc(net);
-
- return rv;
+ return pfkey_init_proc(net);
}

static void __net_exit pfkey_net_exit(struct net *net)
--
2.15.2
\
 
 \ /
  Last update: 2022-11-02 14:48    [W:0.039 / U:0.560 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site