Browse Source

vxlan: fix potential NULL dereference in arp_reduce()

This patch fixes a NULL pointer dereference in the event of an
skb allocation failure in arp_reduce().

Signed-Off-By: David L Stevens <dlstevens@us.ibm.com>
Acked-by: Cong Wang <cwang@twopensource.com>

Signed-off-by: David S. Miller <davem@davemloft.net>
David Stevens 11 years ago
parent
commit
7346135dcd
1 changed files with 3 additions and 0 deletions
  1. 3 0
      drivers/net/vxlan.c

+ 3 - 0
drivers/net/vxlan.c

@@ -1318,6 +1318,9 @@ static int arp_reduce(struct net_device *dev, struct sk_buff *skb)
 
 
 		neigh_release(n);
 		neigh_release(n);
 
 
+		if (reply == NULL)
+			goto out;
+
 		skb_reset_mac_header(reply);
 		skb_reset_mac_header(reply);
 		__skb_pull(reply, skb_network_offset(reply));
 		__skb_pull(reply, skb_network_offset(reply));
 		reply->ip_summed = CHECKSUM_UNNECESSARY;
 		reply->ip_summed = CHECKSUM_UNNECESSARY;