提交 9b1536c4 编写于 作者: G Gao feng 提交者: David S. Miller

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: NGao feng <gaofeng@cn.fujitsu.com>
Acked-by: NCong Wang <amwang@redhat.com>
Signed-off-by: NDavid S. Miller <davem@davemloft.net>
上级 9650388b
...@@ -366,11 +366,11 @@ int br_add_if(struct net_bridge *br, struct net_device *dev) ...@@ -366,11 +366,11 @@ int br_add_if(struct net_bridge *br, struct net_device *dev)
err = netdev_set_master(dev, br->dev); err = netdev_set_master(dev, br->dev);
if (err) if (err)
goto err3; goto err4;
err = netdev_rx_handler_register(dev, br_handle_frame, p); err = netdev_rx_handler_register(dev, br_handle_frame, p);
if (err) if (err)
goto err4; goto err5;
dev->priv_flags |= IFF_BRIDGE_PORT; dev->priv_flags |= IFF_BRIDGE_PORT;
...@@ -402,8 +402,10 @@ int br_add_if(struct net_bridge *br, struct net_device *dev) ...@@ -402,8 +402,10 @@ int br_add_if(struct net_bridge *br, struct net_device *dev)
return 0; return 0;
err4: err5:
netdev_set_master(dev, NULL); netdev_set_master(dev, NULL);
err4:
br_netpoll_disable(p);
err3: err3:
sysfs_remove_link(br->ifobj, p->dev->name); sysfs_remove_link(br->ifobj, p->dev->name);
err2: err2:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册