Commit cee48541 authored by Stephen Hemminger's avatar Stephen Hemminger Committed by David S. Miller

[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: default avatarStephen Hemminger <shemminger@osdl.org>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 3b781fa1
...@@ -210,7 +210,8 @@ static struct net_device *new_bridge_dev(const char *name) ...@@ -210,7 +210,8 @@ static struct net_device *new_bridge_dev(const char *name)
br->bridge_id.prio[0] = 0x80; br->bridge_id.prio[0] = 0x80;
br->bridge_id.prio[1] = 0x00; br->bridge_id.prio[1] = 0x00;
memset(br->bridge_id.addr, 0, ETH_ALEN);
memcpy(br->group_addr, br_group_address, ETH_ALEN);
br->feature_mask = dev->features; br->feature_mask = dev->features;
br->stp_enabled = 0; br->stp_enabled = 0;
...@@ -263,11 +264,10 @@ static struct net_bridge_port *new_nbp(struct net_bridge *br, ...@@ -263,11 +264,10 @@ static struct net_bridge_port *new_nbp(struct net_bridge *br,
if (index < 0) if (index < 0)
return ERR_PTR(index); return ERR_PTR(index);
p = kmalloc(sizeof(*p), GFP_KERNEL); p = kzalloc(sizeof(*p), GFP_KERNEL);
if (p == NULL) if (p == NULL)
return ERR_PTR(-ENOMEM); return ERR_PTR(-ENOMEM);
memset(p, 0, sizeof(*p));
p->br = br; p->br = br;
dev_hold(dev); dev_hold(dev);
p->dev = dev; p->dev = dev;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment