# Patch for http://bugme.osdl.org/show_bug.cgi?id=1130 # Applies cleanly to 2.6.0-test5 # Michal Ludvig --- linux-2.6.0-test5-clean/net/ipv4/ip_gre.c 2003-09-08 21:50:18.000000000 +0200 +++ linux-2.6.0-test5/net/ipv4/ip_gre.c 2003-09-23 16:50:09.000000000 +0200 @@ -271,13 +271,17 @@ static struct ip_tunnel * ipgre_tunnel_l } dev = alloc_netdev(sizeof(*t), name, ipgre_tunnel_setup); + if (!dev) + return NULL; + + dev->init = ipgre_tunnel_init; + if (register_netdevice(dev) < 0) { kfree(dev); goto failed; } nt = dev->priv; - dev->init = ipgre_tunnel_init; nt->parms = *parms; dev_hold(dev);