Message ID | 20250319230743.65267-6-kuniyu@amazon.com (mailing list archive) |
---|---|
State | New |
Delegated to: | Netdev Maintainers |
Headers | show |
Series | nexthop: Convert RTM_{NEW,DEL}NEXTHOP to per-netns RTNL. | expand |
On Thu, Mar 20, 2025 at 12:10 AM Kuniyuki Iwashima <kuniyu@amazon.com> wrote: > > 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>
On 3/19/25 5:06 PM, Kuniyuki Iwashima wrote: > 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> > --- > net/ipv4/nexthop.c | 3 --- > 1 file changed, 3 deletions(-) > Reviewed-by: David Ahern <dsahern@kernel.org>
diff --git a/net/ipv4/nexthop.c b/net/ipv4/nexthop.c index fb129c830040..c552bb46aa23 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);
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> --- net/ipv4/nexthop.c | 3 --- 1 file changed, 3 deletions(-)