Skip to content

Commit

Permalink
net: mv643xx_eth: use kzalloc
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Rasmus Villemoes authored and David S. Miller committed Sep 10, 2015
1 parent e9b5ac2 commit b66a608
Showing 1 changed file with 1 addition and 4 deletions.
5 changes: 1 addition & 4 deletions drivers/net/ethernet/marvell/mv643xx_eth.c
Original file line number Diff line number Diff line change
Expand Up @@ -1859,14 +1859,11 @@ static void mv643xx_eth_program_multicast_filter(struct net_device *dev)
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;
Expand Down

0 comments on commit b66a608

Please sign in to comment.