From: Stephen Hemminger Date: Tue, 21 Mar 2006 06:56:50 +0000 (-0800) Subject: [BRIDGE]: use kcalloc X-Git-Tag: v2.6.17-rc1~1175^2~20 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=3b781fa10bcdb148924d1847f68899583e0d66ef;p=profile%2Fivi%2Fkernel-x86-ivi.git [BRIDGE]: use kcalloc Use kcalloc rather than kmalloc + memset. Signed-off-by: Stephen Hemminger Signed-off-by: David S. Miller --- diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c index f36b35e..738cb3a 100644 --- a/net/bridge/br_if.c +++ b/net/bridge/br_if.c @@ -237,12 +237,11 @@ static int find_portno(struct net_bridge *br) struct net_bridge_port *p; unsigned long *inuse; - inuse = kmalloc(BITS_TO_LONGS(BR_MAX_PORTS)*sizeof(unsigned long), + inuse = kcalloc(BITS_TO_LONGS(BR_MAX_PORTS), sizeof(unsigned long), GFP_KERNEL); if (!inuse) return -ENOMEM; - memset(inuse, 0, BITS_TO_LONGS(BR_MAX_PORTS)*sizeof(unsigned long)); set_bit(0, inuse); /* zero is reserved */ list_for_each_entry(p, &br->port_list, list) { set_bit(p->port_no, inuse);