Skip to contentSkip to conversation

net: ipv4: remove redundant assignment to variable rc

PATCH Applied Colin King 2 participants 2 messages Apr 20, 2020

Subsystems (3)
lore
Share & tools
lore

Colin King

author
#0 lore raw

PATCH 1/1 net: ipv4: remove redundant assignment to variable rc

From: Colin Ian King <[email protected]>

The variable rc is being assigned with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed.

Addresses-Coverity: ("Unused value")

---
 net/ipv4/af_inet.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
net/ipv4/af_inet.c +1 -1
index cf58e29cf746..c618e242490f 100644
@@ -1914,7 +1914,7 @@ static int __init inet_init(void)
 {
 	struct inet_protosw *q;
 	struct list_head *r;
-	int rc = -EINVAL;
+	int rc;
 
 	sock_skb_cb_check_size(sizeof(struct inet_skb_parm));
 
Signature · 1 line
2.25.1
maintainer Applied
#1 lore raw

From: Colin King <[email protected]>
Date: Mon, 20 Apr 2020 22:51:49 +0100

Quoted 8 lines

From: Colin Ian King <[email protected]>

The variable rc is being assigned with a value that is never read and it is being updated later with a new value. The initialization is redundant and can be removed.

Addresses-Coverity: ("Unused value")

Applied to net-next, thanks.