Commit a9a8cdb3 authored by Varun Prakash's avatar Varun Prakash Committed by David S. Miller

libcxgb: fix error check for ip6_route_output()

ip6_route_output() never returns NULL so
check dst->error instead of !dst.
Signed-off-by: default avatarVarun Prakash <varun@chelsio.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 63dfb0da
...@@ -133,17 +133,15 @@ cxgb_find_route6(struct cxgb4_lld_info *lldi, ...@@ -133,17 +133,15 @@ cxgb_find_route6(struct cxgb4_lld_info *lldi,
if (ipv6_addr_type(&fl6.daddr) & IPV6_ADDR_LINKLOCAL) if (ipv6_addr_type(&fl6.daddr) & IPV6_ADDR_LINKLOCAL)
fl6.flowi6_oif = sin6_scope_id; fl6.flowi6_oif = sin6_scope_id;
dst = ip6_route_output(&init_net, NULL, &fl6); dst = ip6_route_output(&init_net, NULL, &fl6);
if (!dst) if (dst->error ||
goto out; (!cxgb_our_interface(lldi, get_real_dev,
if (!cxgb_our_interface(lldi, get_real_dev, ip6_dst_idev(dst)->dev) &&
ip6_dst_idev(dst)->dev) && !(ip6_dst_idev(dst)->dev->flags & IFF_LOOPBACK))) {
!(ip6_dst_idev(dst)->dev->flags & IFF_LOOPBACK)) {
dst_release(dst); dst_release(dst);
dst = NULL; return NULL;
} }
} }
out:
return dst; return dst;
} }
EXPORT_SYMBOL(cxgb_find_route6); EXPORT_SYMBOL(cxgb_find_route6);
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment