From b6af3890574a674d54216dacb66470fb7147b835 Mon Sep 17 00:00:00 2001 From: Kuniyuki Iwashima Date: Wed, 19 Mar 2025 16:06:50 -0700 Subject: [PATCH] nexthop: Remove redundant group len check in nexthop_create_group(). The number of NHA_GROUP entries is guaranteed to be non-zero in nh_check_attr_group(). Let's remove the redundant check in nexthop_create_group(). Signed-off-by: Kuniyuki Iwashima Reviewed-by: Eric Dumazet Reviewed-by: David Ahern Link: https://patch.msgid.link/20250319230743.65267-6-kuniyu@amazon.com Signed-off-by: Jakub Kicinski --- net/ipv4/nexthop.c | 3 --- 1 file changed, 3 deletions(-) diff --git a/net/ipv4/nexthop.c b/net/ipv4/nexthop.c index fb129c8300406..c552bb46aa23c 100644 --- a/net/ipv4/nexthop.c +++ b/net/ipv4/nexthop.c @@ -2692,9 +2692,6 @@ static struct nexthop *nexthop_create_group(struct net *net, int err; int i; - if (WARN_ON(!num_nh)) - return ERR_PTR(-EINVAL); - nh = nexthop_alloc(); if (!nh) return ERR_PTR(-ENOMEM); -- 2.50.1