Skip to content

Commit

Permalink
bridge: bad error handling when adding invalid ether address
Browse files Browse the repository at this point in the history
[ Upstream commit cda6d37 ]

This fixes an crash when empty bond device is added to a bridge.
If an interface with invalid ethernet address (all zero) is added
to a bridge, then bridge code detects it when setting up the forward
databas entry. But the error unwind is broken, the bridge port object
can get freed twice: once when ref count went to zeo, and once by kfree.
Since object is never really accessible, just free it.

Signed-off-by: Stephen Hemminger <shemminger@vyatta.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Chris Wright <chrisw@sous-sol.org>
  • Loading branch information
Stephen Hemminger authored and Chris Wright committed Apr 2, 2009
1 parent dcd2d49 commit 813352b
Showing 1 changed file with 0 additions and 1 deletion.
1 change: 0 additions & 1 deletion net/bridge/br_if.c
Original file line number Diff line number Diff line change
Expand Up @@ -426,7 +426,6 @@ int br_add_if(struct net_bridge *br, struct net_device *dev)
err1:
kobject_del(&p->kobj);
err0:
kobject_put(&p->kobj);
dev_set_promiscuity(dev, -1);
put_back:
dev_put(dev);
Expand Down

0 comments on commit 813352b

Please sign in to comment.