summaryrefslogtreecommitdiffstats
path: root/drivers/net/cnic.c
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2011-03-02 14:31:35 -0800
committerDavid S. Miller <davem@davemloft.net>2011-03-02 14:31:35 -0800
commitb23dd4fe42b455af5c6e20966b7d6959fa8352ea (patch)
treebf97323eae9a8d084170e573ff2c0c40bc72c3cd /drivers/net/cnic.c
parent452edd598f60522c11f7f88fdbab27eb36509d1a (diff)
ipv4: Make output route lookup return rtable directly.
Instead of on the stack. Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/cnic.c')
-rw-r--r--drivers/net/cnic.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/net/cnic.c b/drivers/net/cnic.c
index 5274de3e1bb..25f08880ae0 100644
--- a/drivers/net/cnic.c
+++ b/drivers/net/cnic.c
@@ -3397,9 +3397,12 @@ static int cnic_get_v4_route(struct sockaddr_in *dst_addr,
memset(&fl, 0, sizeof(fl));
fl.nl_u.ip4_u.daddr = dst_addr->sin_addr.s_addr;
- err = ip_route_output_key(&init_net, &rt, &fl);
- if (!err)
+ rt = ip_route_output_key(&init_net, &fl);
+ err = 0;
+ if (!IS_ERR(rt))
*dst = &rt->dst;
+ else
+ err = PTR_ERR(rt);
return err;
#else
return -ENETUNREACH;