]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
net: rtnetlink: remove redundant assignment to variable err
authorColin Ian King <colin.king@canonical.com>
Sat, 25 Apr 2020 11:28:14 +0000 (12:28 +0100)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 29 Oct 2025 12:59:58 +0000 (13:59 +0100)
[ Upstream commit 7d3118016787b5c05da94b3bcdb96c9d6ff82c44 ]

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>
Signed-off-by: David S. Miller <davem@davemloft.net>
Stable-dep-of: bf29555f5bdc ("rtnetlink: Allow deleting FDB entries in user namespace")
Signed-off-by: Sasha Levin <sashal@kernel.org>
net/core/rtnetlink.c

index 2b7ad5cf8fbfd0387582c46790da66be13ef0a4d..f1338734c2eeefa439357f349e19bed57c42466a 100644 (file)
@@ -3823,8 +3823,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))