Convert as many things as possible to use kzalloc
[madwifi/.git] / ath / if_athvar.h
index 31d2f50c7234fbfbdf3d67d6bf53e5ca9a7cf994..667f60687c17e416e65bdf54631c04bc65a31ca1 100644 (file)
@@ -136,15 +136,12 @@ static inline struct net_device *_alloc_netdev(int sizeof_priv, const char *mask
        /* ensure 32-byte alignment of the private area */
        alloc_size = sizeof (*dev) + sizeof_priv + 31;
 
-       dev = (struct net_device *) kmalloc (alloc_size, GFP_KERNEL);
-       if (dev == NULL)
-       {
+       dev = (struct net_device *)kzalloc(alloc_size, GFP_KERNEL);
+       if (dev == NULL) {
                printk(KERN_ERR "alloc_dev: Unable to allocate device memory.\n");
                return NULL;
        }
 
-       memset(dev, 0, alloc_size);
-
        if (sizeof_priv)
                dev->priv = (void *) (((long)(dev + 1) + 31) & ~31);