Skip to content

Commit

Permalink
bridge: call br_netpoll_disable in br_add_if
Browse files Browse the repository at this point in the history
When netdev_set_master faild in br_add_if, we should
call br_netpoll_disable to do some cleanup jobs,such
as free the memory of struct netpoll which allocated
in br_netpoll_enable.

Signed-off-by: Gao feng <[email protected]>
Acked-by: Cong Wang <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
Gao feng authored and davem330 committed Dec 21, 2012
1 parent 9650388 commit 9b1536c
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions net/bridge/br_if.c
Original file line number Diff line number Diff line change
Expand Up @@ -366,11 +366,11 @@ int br_add_if(struct net_bridge *br, struct net_device *dev)

err = netdev_set_master(dev, br->dev);
if (err)
goto err3;
goto err4;

err = netdev_rx_handler_register(dev, br_handle_frame, p);
if (err)
goto err4;
goto err5;

dev->priv_flags |= IFF_BRIDGE_PORT;

Expand Down Expand Up @@ -402,8 +402,10 @@ int br_add_if(struct net_bridge *br, struct net_device *dev)

return 0;

err4:
err5:
netdev_set_master(dev, NULL);
err4:
br_netpoll_disable(p);
err3:
sysfs_remove_link(br->ifobj, p->dev->name);
err2:
Expand Down

0 comments on commit 9b1536c

Please sign in to comment.