diff options
| author | Yue Haibing <yuehaibing@huawei.com> | 2025-06-24 22:00:15 +0800 |
|---|---|---|
| committer | Jakub Kicinski <kuba@kernel.org> | 2025-06-25 16:52:46 -0700 |
| commit | 3b3ccf9ed05e0650273e7086f4d8f495e4b2c850 (patch) | |
| tree | 18da2dc67fd7c3573814990f55168c1aba4ef023 /net/ipv6 | |
| parent | 2855e43c6bb154a9b8e27abda8df364aed574b22 (diff) | |
net: Remove unnecessary NULL check for lwtunnel_fill_encap()
lwtunnel_fill_encap() has NULL check and return 0, so no need
to check before call it.
Signed-off-by: Yue Haibing <yuehaibing@huawei.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Link: https://patch.msgid.link/20250624140015.3929241-1-yuehaibing@huawei.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Diffstat (limited to 'net/ipv6')
| -rw-r--r-- | net/ipv6/route.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/net/ipv6/route.c b/net/ipv6/route.c index d7a9b5bf30c8..46a4f9d1900f 100644 --- a/net/ipv6/route.c +++ b/net/ipv6/route.c @@ -5852,8 +5852,7 @@ static int rt6_fill_node(struct net *net, struct sk_buff *skb, if (dst->dev && nla_put_u32(skb, RTA_OIF, dst->dev->ifindex)) goto nla_put_failure; - if (dst->lwtstate && - lwtunnel_fill_encap(skb, dst->lwtstate, RTA_ENCAP, RTA_ENCAP_TYPE) < 0) + if (lwtunnel_fill_encap(skb, dst->lwtstate, RTA_ENCAP, RTA_ENCAP_TYPE) < 0) goto nla_put_failure; } else if (rt->fib6_nsiblings) { struct fib6_info *sibling; |
