]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
nexthop: Remove redundant group len check in nexthop_create_group().
authorKuniyuki Iwashima <kuniyu@amazon.com>
Wed, 19 Mar 2025 23:06:50 +0000 (16:06 -0700)
committerJakub Kicinski <kuba@kernel.org>
Tue, 25 Mar 2025 14:32:00 +0000 (07:32 -0700)
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 <kuniyu@amazon.com>
Reviewed-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: David Ahern <dsahern@kernel.org>
Link: https://patch.msgid.link/20250319230743.65267-6-kuniyu@amazon.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/ipv4/nexthop.c

index fb129c830040692b028a5e0b44e926b5dc37df67..c552bb46aa23cb431552df68eb76c17aa65f98b4 100644 (file)
@@ -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);