[PATCH net-next] neighbour: Remove redundant assignment to err

Yue Haibing posted 1 patch 3 months ago
net/core/neighbour.c | 4 +---
1 file changed, 1 insertion(+), 3 deletions(-)
[PATCH net-next] neighbour: Remove redundant assignment to err
Posted by Yue Haibing 3 months ago
'err' has been checked against 0 in the if statement.

Signed-off-by: Yue Haibing <yuehaibing@huawei.com>
---
 net/core/neighbour.c | 4 +---
 1 file changed, 1 insertion(+), 3 deletions(-)

diff --git a/net/core/neighbour.c b/net/core/neighbour.c
index 85a5535de8ba..8ad9898f8e42 100644
--- a/net/core/neighbour.c
+++ b/net/core/neighbour.c
@@ -2055,10 +2055,8 @@ static int neigh_add(struct sk_buff *skb, struct nlmsghdr *nlh,
 
 	err = __neigh_update(neigh, lladdr, ndm->ndm_state, flags,
 			     NETLINK_CB(skb).portid, extack);
-	if (!err && ndm_flags & (NTF_USE | NTF_MANAGED)) {
+	if (!err && ndm_flags & (NTF_USE | NTF_MANAGED))
 		neigh_event_send(neigh, NULL);
-		err = 0;
-	}
 	neigh_release(neigh);
 out:
 	return err;
-- 
2.34.1
Re: [PATCH net-next] neighbour: Remove redundant assignment to err
Posted by Simon Horman 3 months ago
On Tue, Jun 24, 2025 at 09:42:16AM +0800, Yue Haibing wrote:
> 'err' has been checked against 0 in the if statement.
> 
> Signed-off-by: Yue Haibing <yuehaibing@huawei.com>

Reviewed-by: Simon Horman <horms@kernel.org>