From: RongQing.Li Date: Tue, 21 Feb 2012 22:10:50 +0000 (+0000) Subject: ethernet/broadcom: ip6_route_output() never returns NULL. X-Git-Tag: MMI-PSA29.97-13-9~17395^2~14 X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=0541743b4b35f2ddc9e490b4e354930168b60d23;p=GitHub%2FMotorolaMobilityLLC%2Fkernel-slsi.git ethernet/broadcom: ip6_route_output() never returns NULL. ip6_route_output() never returns NULL, so it is wrong to check if the return value is NULL. Signed-off-by: RongQing.Li Signed-off-by: David S. Miller --- diff --git a/drivers/net/ethernet/broadcom/cnic.c b/drivers/net/ethernet/broadcom/cnic.c index dd3a0a232ea0..818a573669e6 100644 --- a/drivers/net/ethernet/broadcom/cnic.c +++ b/drivers/net/ethernet/broadcom/cnic.c @@ -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