aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/xfrm4_policy.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv4/xfrm4_policy.c')
-rw-r--r--net/ipv4/xfrm4_policy.c12
1 files changed, 5 insertions, 7 deletions
diff --git a/net/ipv4/xfrm4_policy.c b/net/ipv4/xfrm4_policy.c
index 5f0f058dc376..45b821480427 100644
--- a/net/ipv4/xfrm4_policy.c
+++ b/net/ipv4/xfrm4_policy.c
@@ -26,18 +26,16 @@ static struct dst_entry *xfrm4_dst_lookup(struct net *net, int tos,
26 .fl4_dst = daddr->a4, 26 .fl4_dst = daddr->a4,
27 .fl4_tos = tos, 27 .fl4_tos = tos,
28 }; 28 };
29 struct dst_entry *dst;
30 struct rtable *rt; 29 struct rtable *rt;
31 int err;
32 30
33 if (saddr) 31 if (saddr)
34 fl.fl4_src = saddr->a4; 32 fl.fl4_src = saddr->a4;
35 33
36 err = __ip_route_output_key(net, &rt, &fl); 34 rt = __ip_route_output_key(net, &fl);
37 dst = &rt->dst; 35 if (!IS_ERR(rt))
38 if (err) 36 return &rt->dst;
39 dst = ERR_PTR(err); 37
40 return dst; 38 return ERR_CAST(rt);
41} 39}
42 40
43static int xfrm4_get_saddr(struct net *net, 41static int xfrm4_get_saddr(struct net *net,