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/ipv4/route.c | |
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/ipv4/route.c')
-rw-r--r-- | net/ipv4/route.c | 3 |
1 files changed, 1 insertions, 2 deletions
diff --git a/net/ipv4/route.c b/net/ipv4/route.c index 3ff2bd56d050..a2b7cadf66af 100644 --- a/net/ipv4/route.c +++ b/net/ipv4/route.c @@ -2978,8 +2978,7 @@ static int rt_fill_info(struct net *net, __be32 dst, __be32 src, if (rt->dst.dev && nla_put_u32(skb, RTA_OIF, rt->dst.dev->ifindex)) goto nla_put_failure; - if (rt->dst.lwtstate && - lwtunnel_fill_encap(skb, rt->dst.lwtstate, RTA_ENCAP, RTA_ENCAP_TYPE) < 0) + if (lwtunnel_fill_encap(skb, rt->dst.lwtstate, RTA_ENCAP, RTA_ENCAP_TYPE) < 0) goto nla_put_failure; #ifdef CONFIG_IP_ROUTE_CLASSID if (rt->dst.tclassid && |