]> git.baikalelectronics.ru Git - kernel.git/commit
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)
committerDavid S. Miller <davem@davemloft.net>
Mon, 26 Nov 2012 22:24:41 +0000 (17:24 -0500)
commit11f62ba7577ba95467b01b021a350837c59d2940
treea52a085c1c041bcc2ad7797e7c7526f8eae842ae
parent173bd9c2935e9379aa9e1efac74eddc505b0fccd
ipv4: avoid passing NULL to inet_putpeer() in icmpv4_xrlim_allow()

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:
3e3c470dd0c241a0609c5fed912e6cc901a4ea2c ("inet: Minimize use of
cached route inetpeer.").

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