Use kcalloc rather than kmalloc + memset.

Signed-off-by: Stephen Hemminger <[EMAIL PROTECTED]>

Index: br-2.6/net/bridge/br_if.c
===================================================================
--- br-2.6.orig/net/bridge/br_if.c
+++ br-2.6/net/bridge/br_if.c
@@ -237,12 +237,11 @@ static int find_portno(struct net_bridge
        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);

--

-
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to [EMAIL PROTECTED]
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Reply via email to