Skip to content

Commit

Permalink
libcxgb: fix error check for ip6_route_output()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Varun Prakash authored and David S. Miller committed Jan 4, 2017
1 parent 63dfb0d commit a9a8cdb
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions drivers/net/ethernet/chelsio/libcxgb/libcxgb_cm.c
Original file line number Diff line number Diff line change
Expand Up @@ -133,17 +133,15 @@ cxgb_find_route6(struct cxgb4_lld_info *lldi,
if (ipv6_addr_type(&fl6.daddr) & IPV6_ADDR_LINKLOCAL)
fl6.flowi6_oif = sin6_scope_id;
dst = ip6_route_output(&init_net, NULL, &fl6);
if (!dst)
goto out;
if (!cxgb_our_interface(lldi, get_real_dev,
ip6_dst_idev(dst)->dev) &&
!(ip6_dst_idev(dst)->dev->flags & IFF_LOOPBACK)) {
if (dst->error ||
(!cxgb_our_interface(lldi, get_real_dev,
ip6_dst_idev(dst)->dev) &&
!(ip6_dst_idev(dst)->dev->flags & IFF_LOOPBACK))) {
dst_release(dst);
dst = NULL;
return NULL;
}
}

out:
return dst;
}
EXPORT_SYMBOL(cxgb_find_route6);

0 comments on commit a9a8cdb

Please sign in to comment.