X-Git-Url: http://git.onelab.eu/?a=blobdiff_plain;f=net%2Fwanrouter%2Fwanmain.c;fp=net%2Fwanrouter%2Fwanmain.c;h=c34833dc7cc161f6664f8a487e4162b871606fae;hb=64ba3f394c830ec48a1c31b53dcae312c56f1604;hp=9479659277aeea861b7aafaa96a3f6d8823411b8;hpb=be1e6109ac94a859551f8e1774eb9a8469fe055c;p=linux-2.6.git diff --git a/net/wanrouter/wanmain.c b/net/wanrouter/wanmain.c index 947965927..c34833dc7 100644 --- a/net/wanrouter/wanmain.c +++ b/net/wanrouter/wanmain.c @@ -42,6 +42,7 @@ * Jun 02, 1999 Gideon Hack Updates for Linux 2.0.X and 2.2.X kernels. *****************************************************************************/ +#include #include /* offsetof(), etc. */ #include #include /* return codes */ @@ -642,16 +643,18 @@ static int wanrouter_device_new_if(struct wan_device *wandev, if (cnf->config_id == WANCONFIG_MPPP) { #ifdef CONFIG_WANPIPE_MULTPPP - pppdev = kzalloc(sizeof(struct ppp_device), GFP_KERNEL); + pppdev = kmalloc(sizeof(struct ppp_device), GFP_KERNEL); err = -ENOBUFS; if (pppdev == NULL) goto out; - pppdev->dev = kzalloc(sizeof(struct net_device), GFP_KERNEL); + memset(pppdev, 0, sizeof(struct ppp_device)); + pppdev->dev = kmalloc(sizeof(struct net_device), GFP_KERNEL); if (pppdev->dev == NULL) { kfree(pppdev); err = -ENOBUFS; goto out; } + memset(pppdev->dev, 0, sizeof(struct net_device)); err = wandev->new_if(wandev, (struct net_device *)pppdev, cnf); dev = pppdev->dev; #else @@ -661,10 +664,11 @@ static int wanrouter_device_new_if(struct wan_device *wandev, goto out; #endif } else { - dev = kzalloc(sizeof(struct net_device), GFP_KERNEL); + dev = kmalloc(sizeof(struct net_device), GFP_KERNEL); err = -ENOBUFS; if (dev == NULL) goto out; + memset(dev, 0, sizeof(struct net_device)); err = wandev->new_if(wandev, dev, cnf); }