projects
/
openwrt
/
staging
/
blogic.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
| inline |
side by side
(parent:
a95fcac
)
[BRIDGE]: use kcalloc
author
Stephen Hemminger
<
[email protected]
>
Tue, 21 Mar 2006 06:56:50 +0000
(22:56 -0800)
committer
David S. Miller
<
[email protected]
>
Tue, 21 Mar 2006 06:56:50 +0000
(22:56 -0800)
Use kcalloc rather than kmalloc + memset.
Signed-off-by: Stephen Hemminger <
[email protected]
>
Signed-off-by: David S. Miller <
[email protected]
>
net/bridge/br_if.c
patch
|
blob
|
history
diff --git
a/net/bridge/br_if.c
b/net/bridge/br_if.c
index f36b35edd60cefcbb27c7f3752a9ca3348242f94..738cb3afa99a859477fac6c11e443e4ad0f3f220 100644
(file)
--- 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 = k
malloc(BITS_TO_LONGS(BR_MAX_PORTS)*
sizeof(unsigned long),
+ inuse = k
calloc(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);