Commit e1a67642 authored by Neal Cardwell's avatar Neal Cardwell Committed by David S. Miller
Browse files

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

This code path now uses the same idiom as the others from:

 ("inet: Minimize use of
cached route inetpeer.").
Signed-off-by: default avatarNeal Cardwell <>
Signed-off-by: default avatarDavid S. Miller <>
parent 81b40110
......@@ -257,7 +257,8 @@ static inline bool icmpv4_xrlim_allow(struct net *net, struct rtable *rt,
struct inet_peer *peer = inet_getpeer_v4(net->ipv4.peers, fl4->daddr, 1);
rc = inet_peer_xrlim_allow(peer,
if (peer)
return rc;
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment