ipv4: avoid passing NULL to inet_putpeer() in icmpv4_xrlim_allow()
authorNeal Cardwell <ncardwell@google.com>
Sat, 24 Nov 2012 18:54:37 +0000 (18:54 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 17 Dec 2012 17:27:18 +0000 (09:27 -0800)
commit67e248587152f3976ab9277a48442dbec1ac6fdd
tree6ccae442ed8be03bcc55dc7e7221cc908dff5d6e
parent1322cf6f121852ba706ec7ae7dab636fe4533447
ipv4: avoid passing NULL to inet_putpeer() in icmpv4_xrlim_allow()

[ Upstream commit e1a676424c290b1c8d757e3860170ac7ecd89af4 ]

inet_getpeer_v4() can return NULL under OOM conditions, and while
inet_peer_xrlim_allow() is OK with a NULL peer, inet_putpeer() will
crash.

This code path now uses the same idiom as the others from:
1d861aa4b3fb08822055345f480850205ffe6170 ("inet: Minimize use of
cached route inetpeer.").

Signed-off-by: Neal Cardwell <ncardwell@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/ipv4/icmp.c