diff options
author | Gao feng <gaofeng@cn.fujitsu.com> | 2012-12-19 18:41:43 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2012-12-21 16:17:07 -0500 |
commit | 9b1536c490d572f2ed4af0a15bd5d6cf349a9db4 (patch) | |
tree | de6ce47b0545fdee53eac2c3455117110a4ed397 /net | |
parent | 9650388b5c56578fdccc79c57a8c82fb92b8e7f1 (diff) |
bridge: call br_netpoll_disable in br_add_if
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 <gaofeng@cn.fujitsu.com>
Acked-by: Cong Wang <amwang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net')
-rw-r--r-- | net/bridge/br_if.c | 8 |
1 files changed, 5 insertions, 3 deletions
diff --git a/net/bridge/br_if.c b/net/bridge/br_if.c index 1c8fdc3558cd..37fe693471a8 100644 --- a/net/bridge/br_if.c +++ b/net/bridge/br_if.c | |||
@@ -366,11 +366,11 @@ int br_add_if(struct net_bridge *br, struct net_device *dev) | |||
366 | 366 | ||
367 | err = netdev_set_master(dev, br->dev); | 367 | err = netdev_set_master(dev, br->dev); |
368 | if (err) | 368 | if (err) |
369 | goto err3; | 369 | goto err4; |
370 | 370 | ||
371 | err = netdev_rx_handler_register(dev, br_handle_frame, p); | 371 | err = netdev_rx_handler_register(dev, br_handle_frame, p); |
372 | if (err) | 372 | if (err) |
373 | goto err4; | 373 | goto err5; |
374 | 374 | ||
375 | dev->priv_flags |= IFF_BRIDGE_PORT; | 375 | dev->priv_flags |= IFF_BRIDGE_PORT; |
376 | 376 | ||
@@ -402,8 +402,10 @@ int br_add_if(struct net_bridge *br, struct net_device *dev) | |||
402 | 402 | ||
403 | return 0; | 403 | return 0; |
404 | 404 | ||
405 | err4: | 405 | err5: |
406 | netdev_set_master(dev, NULL); | 406 | netdev_set_master(dev, NULL); |
407 | err4: | ||
408 | br_netpoll_disable(p); | ||
407 | err3: | 409 | err3: |
408 | sysfs_remove_link(br->ifobj, p->dev->name); | 410 | sysfs_remove_link(br->ifobj, p->dev->name); |
409 | err2: | 411 | err2: |