linux 2.6.16.38 w/ vs2.0.3-rc1
[linux-2.6.git] / net / wanrouter / wanmain.c
index 9479659..c34833d 100644 (file)
@@ -42,6 +42,7 @@
 * Jun 02, 1999  Gideon Hack    Updates for Linux 2.0.X and 2.2.X kernels.
 *****************************************************************************/
 
+#include <linux/config.h>
 #include <linux/stddef.h>      /* offsetof(), etc. */
 #include <linux/capability.h>
 #include <linux/errno.h>       /* 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);
        }