From 56d8f7888f1230c444349494ad24926ada2f56e1 Mon Sep 17 00:00:00 2001 From: Colin Cross Date: Sun, 9 Oct 2011 02:27:08 +0100 Subject: net: ipv4: tcp: Fix crash in tcp_nuke_addr ip_route_output_key can return an ERR_PTR, don't dereference it. Change-Id: I6b86a451b2bdb33873d79b3cf90c11dbe72bc081 Signed-off-by: Colin Cross --- net/ipv4/tcp.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'net') diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index d1e438fa0e2..5eb7af23461 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c @@ -3328,7 +3328,7 @@ static int tcp_is_local(struct net *net, __be32 addr) { struct rtable *rt; struct flowi4 fl4 = { .daddr = addr }; rt = ip_route_output_key(net, &fl4); - if (!rt) + if (IS_ERR_OR_NULL(rt)) return 0; return rt->dst.dev && (rt->dst.dev->flags & IFF_LOOPBACK); } -- cgit v1.2.3