net: mv643xx_eth: use kzalloc
authorRasmus Villemoes <linux@rasmusvillemoes.dk>
Wed, 9 Sep 2015 08:38:04 +0000 (10:38 +0200)
committerDavid S. Miller <davem@davemloft.net>
Thu, 10 Sep 2015 00:06:00 +0000 (17:06 -0700)
The double memset is a little ugly; using kzalloc avoids it altogether.

Signed-off-by: Rasmus Villemoes <linux@rasmusvillemoes.dk>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/ethernet/marvell/mv643xx_eth.c

index d52639bc491f7a1aa76f8bd127df8b9e68be0332..960169efe636a659241f7e8fae10706fd0503939 100644 (file)
@@ -1859,14 +1859,11 @@ oom:
                return;
        }
 
-       mc_spec = kmalloc(0x200, GFP_ATOMIC);
+       mc_spec = kzalloc(0x200, GFP_ATOMIC);
        if (mc_spec == NULL)
                goto oom;
        mc_other = mc_spec + (0x100 >> 2);
 
-       memset(mc_spec, 0, 0x100);
-       memset(mc_other, 0, 0x100);
-
        netdev_for_each_mc_addr(ha, dev) {
                u8 *a = ha->addr;
                u32 *table;