Skip to content

Commit

Permalink
ethernet/broadcom: ip6_route_output() never returns NULL.
Browse files Browse the repository at this point in the history
ip6_route_output() never returns NULL, so it is wrong to
check if the return value is NULL.

Signed-off-by: RongQing.Li <roy.qing.li@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
RongQing.Li authored and David S. Miller committed Feb 22, 2012
1 parent 5095d64 commit 0541743
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion drivers/net/ethernet/broadcom/cnic.c
Original file line number Diff line number Diff line change
Expand Up @@ -3584,7 +3584,11 @@ static int cnic_get_v6_route(struct sockaddr_in6 *dst_addr,
fl6.flowi6_oif = dst_addr->sin6_scope_id;

*dst = ip6_route_output(&init_net, NULL, &fl6);
if (*dst)
if ((*dst)->error) {
dst_release(*dst);
*dst = NULL;
return -ENETUNREACH;
} else
return 0;
#endif

Expand Down

0 comments on commit 0541743

Please sign in to comment.