diff options
author | Li Zetao <lizetao1@huawei.com> | 2024-08-22 12:32:45 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2024-08-23 14:27:45 +0100 |
commit | c25bdd2ac8cf7da70a226f1a66cdce7af15ff86f (patch) | |
tree | 88e47477c86b36d6924411932b9c12825a333ef0 /net/core | |
parent | 41aa426392be26865a8a774df3e5ec4c56a98b26 (diff) |
neighbour: delete redundant judgment statements
The initial value of err is -ENOBUFS, and err is guaranteed to be
less than 0 before all goto errout. Therefore, on the error path
of errout, there is no need to repeatedly judge that err is less than 0,
and delete redundant judgments to make the code more concise.
Signed-off-by: Li Zetao <lizetao1@huawei.com>
Reviewed-by: Petr Machata <petrm@nvidia.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
-rw-r--r-- | net/core/neighbour.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/net/core/neighbour.c b/net/core/neighbour.c index a6fe88eca939..77b819cd995b 100644 --- a/net/core/neighbour.c +++ b/net/core/neighbour.c @@ -3530,8 +3530,7 @@ static void __neigh_notify(struct neighbour *n, int type, int flags, rtnl_notify(skb, net, 0, RTNLGRP_NEIGH, NULL, GFP_ATOMIC); return; errout: - if (err < 0) - rtnl_set_sk_err(net, RTNLGRP_NEIGH, err); + rtnl_set_sk_err(net, RTNLGRP_NEIGH, err); } void neigh_app_ns(struct neighbour *n) |