From: Kuniyuki Iwashima Date: Wed, 19 Mar 2025 23:06:50 +0000 (-0700) Subject: nexthop: Remove redundant group len check in nexthop_create_group(). X-Git-Url: https://www.infradead.org/git/?a=commitdiff_plain;h=b6af3890574a674d54216dacb66470fb7147b835;p=users%2Fjedix%2Flinux-maple.git 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 --- 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);