diff options
author | Varun Prakash <varun@chelsio.com> | 2017-01-03 10:55:48 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-01-04 13:25:53 -0500 |
commit | a9a8cdb368d99bb655b5cdabea560446db0527cc (patch) | |
tree | e17849b4cb87bae42f1592f731e66ee5265cc1ab | |
parent | 63dfb0dac9055145db85ce764355aef2f563739a (diff) |
libcxgb: fix error check for ip6_route_output()
ip6_route_output() never returns NULL so
check dst->error instead of !dst.
Signed-off-by: Varun Prakash <varun@chelsio.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r-- | drivers/net/ethernet/chelsio/libcxgb/libcxgb_cm.c | 12 |
1 files changed, 5 insertions, 7 deletions
diff --git a/drivers/net/ethernet/chelsio/libcxgb/libcxgb_cm.c b/drivers/net/ethernet/chelsio/libcxgb/libcxgb_cm.c index 0f0de5b63622..d04a6c163445 100644 --- a/drivers/net/ethernet/chelsio/libcxgb/libcxgb_cm.c +++ b/drivers/net/ethernet/chelsio/libcxgb/libcxgb_cm.c | |||
@@ -133,17 +133,15 @@ cxgb_find_route6(struct cxgb4_lld_info *lldi, | |||
133 | if (ipv6_addr_type(&fl6.daddr) & IPV6_ADDR_LINKLOCAL) | 133 | if (ipv6_addr_type(&fl6.daddr) & IPV6_ADDR_LINKLOCAL) |
134 | fl6.flowi6_oif = sin6_scope_id; | 134 | fl6.flowi6_oif = sin6_scope_id; |
135 | dst = ip6_route_output(&init_net, NULL, &fl6); | 135 | dst = ip6_route_output(&init_net, NULL, &fl6); |
136 | if (!dst) | 136 | if (dst->error || |
137 | goto out; | 137 | (!cxgb_our_interface(lldi, get_real_dev, |
138 | if (!cxgb_our_interface(lldi, get_real_dev, | 138 | ip6_dst_idev(dst)->dev) && |
139 | ip6_dst_idev(dst)->dev) && | 139 | !(ip6_dst_idev(dst)->dev->flags & IFF_LOOPBACK))) { |
140 | !(ip6_dst_idev(dst)->dev->flags & IFF_LOOPBACK)) { | ||
141 | dst_release(dst); | 140 | dst_release(dst); |
142 | dst = NULL; | 141 | return NULL; |
143 | } | 142 | } |
144 | } | 143 | } |
145 | 144 | ||
146 | out: | ||
147 | return dst; | 145 | return dst; |
148 | } | 146 | } |
149 | EXPORT_SYMBOL(cxgb_find_route6); | 147 | EXPORT_SYMBOL(cxgb_find_route6); |