Message ID | 20250318233240.53946-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 |
diff --git a/net/ipv4/nexthop.c b/net/ipv4/nexthop.c index 09f5f31f34a0..409f13d64ed4 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(-)