]>
Commit | Line | Data |
---|---|---|
95244f99 GKH |
1 | From foo@baz Wed Dec 6 17:39:55 CET 2017 |
2 | From: Varun Prakash <varun@chelsio.com> | |
3 | Date: Tue, 3 Jan 2017 21:25:48 +0530 | |
4 | Subject: libcxgb: fix error check for ip6_route_output() | |
5 | ||
6 | From: Varun Prakash <varun@chelsio.com> | |
7 | ||
8 | ||
9 | [ Upstream commit a9a8cdb368d99bb655b5cdabea560446db0527cc ] | |
10 | ||
11 | ip6_route_output() never returns NULL so | |
12 | check dst->error instead of !dst. | |
13 | ||
14 | Signed-off-by: Varun Prakash <varun@chelsio.com> | |
15 | Signed-off-by: David S. Miller <davem@davemloft.net> | |
16 | Signed-off-by: Sasha Levin <alexander.levin@verizon.com> | |
17 | Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org> | |
18 | --- | |
19 | drivers/net/ethernet/chelsio/libcxgb/libcxgb_cm.c | 12 +++++------- | |
20 | 1 file changed, 5 insertions(+), 7 deletions(-) | |
21 | ||
22 | --- a/drivers/net/ethernet/chelsio/libcxgb/libcxgb_cm.c | |
23 | +++ b/drivers/net/ethernet/chelsio/libcxgb/libcxgb_cm.c | |
24 | @@ -133,17 +133,15 @@ cxgb_find_route6(struct cxgb4_lld_info * | |
25 | if (ipv6_addr_type(&fl6.daddr) & IPV6_ADDR_LINKLOCAL) | |
26 | fl6.flowi6_oif = sin6_scope_id; | |
27 | dst = ip6_route_output(&init_net, NULL, &fl6); | |
28 | - if (!dst) | |
29 | - goto out; | |
30 | - if (!cxgb_our_interface(lldi, get_real_dev, | |
31 | - ip6_dst_idev(dst)->dev) && | |
32 | - !(ip6_dst_idev(dst)->dev->flags & IFF_LOOPBACK)) { | |
33 | + if (dst->error || | |
34 | + (!cxgb_our_interface(lldi, get_real_dev, | |
35 | + ip6_dst_idev(dst)->dev) && | |
36 | + !(ip6_dst_idev(dst)->dev->flags & IFF_LOOPBACK))) { | |
37 | dst_release(dst); | |
38 | - dst = NULL; | |
39 | + return NULL; | |
40 | } | |
41 | } | |
42 | ||
43 | -out: | |
44 | return dst; | |
45 | } | |
46 | EXPORT_SYMBOL(cxgb_find_route6); |