vxlan: fix potential NULL dereference in arp_reduce()
authorDavid Stevens <dlstevens@us.ibm.com>
Tue, 18 Mar 2014 16:32:29 +0000 (12:32 -0400)
committerDavid S. Miller <davem@davemloft.net>
Tue, 18 Mar 2014 20:09:34 +0000 (16:09 -0400)
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>
drivers/net/vxlan.c

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