diff mbox series

net: udp: remove redundant initialization in udp_dump_one

Message ID 1604644960-48378-2-git-send-email-dong.menglong@zte.com.cn
State New
Headers show
Series net: udp: remove redundant initialization in udp_dump_one | expand

Commit Message

Menglong Dong Nov. 6, 2020, 6:42 a.m. UTC
From: Menglong Dong <dong.menglong@zte.com.cn>

The initialization for 'err' with '-EINVAL' is redundant and
can be removed, as it is updated soon and not used.

Signed-off-by: Menglong Dong <dong.menglong@zte.com.cn>
---
 net/ipv4/udp_diag.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Jakub Kicinski Nov. 10, 2020, 1:13 a.m. UTC | #1
On Fri,  6 Nov 2020 01:42:38 -0500 menglong8.dong@gmail.com wrote:
> From: Menglong Dong <dong.menglong@zte.com.cn>

> 

> The initialization for 'err' with '-EINVAL' is redundant and

> can be removed, as it is updated soon and not used.

> 

> Signed-off-by: Menglong Dong <dong.menglong@zte.com.cn>


Applied, thanks.
diff mbox series

Patch

diff --git a/net/ipv4/udp_diag.c b/net/ipv4/udp_diag.c
index 1dbece3..b2cee9a 100644
--- a/net/ipv4/udp_diag.c
+++ b/net/ipv4/udp_diag.c
@@ -30,7 +30,7 @@  static int udp_dump_one(struct udp_table *tbl,
 			const struct inet_diag_req_v2 *req)
 {
 	struct sk_buff *in_skb = cb->skb;
-	int err = -EINVAL;
+	int err;
 	struct sock *sk = NULL;
 	struct sk_buff *rep;
 	struct net *net = sock_net(in_skb->sk);