aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@osdl.org>2006-03-21 01:57:03 -0500
committerDavid S. Miller <davem@davemloft.net>2006-03-21 01:57:03 -0500
commitcee4854122d4347b2f6f10fe7f007a48fada29a0 (patch)
treeffff0f0438b9b4729c0fc0c9880e19a221beff28
parent3b781fa10bcdb148924d1847f68899583e0d66ef (diff)
[BRIDGE]: use kzalloc
Use kzalloc versus kmalloc+memset. Also don't need to do memset() of bridge address since it is in netdev private data that is already zero'd in alloc_netdev. Signed-off-by: Stephen Hemminger <shemminger@osdl.org> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/bridge/br_if.c6
1 files changed, 3 insertions, 3 deletions
diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c
index 738cb3afa99a..59eef42d4a42 100644
--- a/net/bridge/br_if.c
+++ b/net/bridge/br_if.c
@@ -210,7 +210,8 @@ static struct net_device *new_bridge_dev(const char *name)
210 210
211 br->bridge_id.prio[0] = 0x80; 211 br->bridge_id.prio[0] = 0x80;
212 br->bridge_id.prio[1] = 0x00; 212 br->bridge_id.prio[1] = 0x00;
213 memset(br->bridge_id.addr, 0, ETH_ALEN); 213
214 memcpy(br->group_addr, br_group_address, ETH_ALEN);
214 215
215 br->feature_mask = dev->features; 216 br->feature_mask = dev->features;
216 br->stp_enabled = 0; 217 br->stp_enabled = 0;
@@ -263,11 +264,10 @@ static struct net_bridge_port *new_nbp(struct net_bridge *br,
263 if (index < 0) 264 if (index < 0)
264 return ERR_PTR(index); 265 return ERR_PTR(index);
265 266
266 p = kmalloc(sizeof(*p), GFP_KERNEL); 267 p = kzalloc(sizeof(*p), GFP_KERNEL);
267 if (p == NULL) 268 if (p == NULL)
268 return ERR_PTR(-ENOMEM); 269 return ERR_PTR(-ENOMEM);
269 270
270 memset(p, 0, sizeof(*p));
271 p->br = br; 271 p->br = br;
272 dev_hold(dev); 272 dev_hold(dev);
273 p->dev = dev; 273 p->dev = dev;