diff mbox series

net: rtnetlink: remove redundant assignment to variable err

Message ID 20200425112814.137857-1-colin.king@canonical.com
State Accepted
Delegated to: David Miller
Headers show
Series net: rtnetlink: remove redundant assignment to variable err | expand

Commit Message

Colin Ian King April 25, 2020, 11:28 a.m. UTC
From: Colin Ian King <colin.king@canonical.com>

The variable err is being initializeed 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")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
---
 net/core/rtnetlink.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

David Miller April 27, 2020, 6:14 p.m. UTC | #1
From: Colin King <colin.king@canonical.com>
Date: Sat, 25 Apr 2020 12:28:14 +0100

> From: Colin Ian King <colin.king@canonical.com>
> 
> The variable err is being initializeed 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")
> Signed-off-by: Colin Ian King <colin.king@canonical.com>

Applied, thanks.
diff mbox series

Patch

diff --git a/net/core/rtnetlink.c b/net/core/rtnetlink.c
index d6f4f4a9e8ba..2269199c5891 100644
--- a/net/core/rtnetlink.c
+++ b/net/core/rtnetlink.c
@@ -3997,8 +3997,8 @@  static int rtnl_fdb_del(struct sk_buff *skb, struct nlmsghdr *nlh,
 	struct ndmsg *ndm;
 	struct nlattr *tb[NDA_MAX+1];
 	struct net_device *dev;
-	int err = -EINVAL;
 	__u8 *addr;
+	int err;
 	u16 vid;
 
 	if (!netlink_capable(skb, CAP_NET_ADMIN))