aboutsummaryrefslogtreecommitdiffstats
path: root/net/bridge/br_if.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/bridge/br_if.c')
-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 f36b35edd60c..738cb3afa99a 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)
237 struct net_bridge_port *p; 237 struct net_bridge_port *p;
238 unsigned long *inuse; 238 unsigned long *inuse;
239 239
240 inuse = kmalloc(BITS_TO_LONGS(BR_MAX_PORTS)*sizeof(unsigned long), 240 inuse = kcalloc(BITS_TO_LONGS(BR_MAX_PORTS), sizeof(unsigned long),
241 GFP_KERNEL); 241 GFP_KERNEL);
242 if (!inuse) 242 if (!inuse)
243 return -ENOMEM; 243 return -ENOMEM;
244 244
245 memset(inuse, 0, BITS_TO_LONGS(BR_MAX_PORTS)*sizeof(unsigned long));
246 set_bit(0, inuse); /* zero is reserved */ 245 set_bit(0, inuse); /* zero is reserved */
247 list_for_each_entry(p, &br->port_list, list) { 246 list_for_each_entry(p, &br->port_list, list) {
248 set_bit(p->port_no, inuse); 247 set_bit(p->port_no, inuse);