]> pilppa.com Git - linux-2.6-omap-h63xx.git/commitdiff
[NET] kzalloc: use in alloc_netdev
authorPaolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Fri, 7 Apr 2006 05:38:28 +0000 (22:38 -0700)
committerDavid S. Miller <davem@sunset.davemloft.net>
Mon, 10 Apr 2006 05:25:47 +0000 (22:25 -0700)
Noticed this use, fixed it.

Signed-off-by: Paolo 'Blaisorblade' Giarrusso <blaisorblade@yahoo.it>
Signed-off-by: David S. Miller <davem@davemloft.net>
net/core/dev.c

index 434220d093aae3f20c4da3bc3881911dd64c0c3c..dfb62998866ae2e298139164a85ec0757b7f3fc7 100644 (file)
@@ -3100,12 +3100,11 @@ struct net_device *alloc_netdev(int sizeof_priv, const char *name,
        alloc_size = (sizeof(*dev) + NETDEV_ALIGN_CONST) & ~NETDEV_ALIGN_CONST;
        alloc_size += sizeof_priv + NETDEV_ALIGN_CONST;
 
-       p = kmalloc(alloc_size, GFP_KERNEL);
+       p = kzalloc(alloc_size, GFP_KERNEL);
        if (!p) {
                printk(KERN_ERR "alloc_dev: Unable to allocate device.\n");
                return NULL;
        }
-       memset(p, 0, alloc_size);
 
        dev = (struct net_device *)
                (((long)p + NETDEV_ALIGN_CONST) & ~NETDEV_ALIGN_CONST);