summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@osdl.org>2006-03-20 22:56:50 -0800
committerDavid S. Miller <davem@davemloft.net>2006-03-20 22:56:50 -0800
commit3b781fa10bcdb148924d1847f68899583e0d66ef (patch)
tree2d2bece150642dad1484748e6da7d22582bed188
parenta95fcacdc33fa12836c306deb085ef3e68bca15a (diff)
downloadop-kernel-dev-3b781fa10bcdb148924d1847f68899583e0d66ef.zip
op-kernel-dev-3b781fa10bcdb148924d1847f68899583e0d66ef.tar.gz
[BRIDGE]: use kcalloc
Use kcalloc rather than kmalloc + memset. Signed-off-by: Stephen Hemminger <shemminger@osdl.org> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/bridge/br_if.c3
1 files changed, 1 insertions, 2 deletions
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);
OpenPOWER on IntegriCloud