Skip to content

Commit

Permalink
bonding: disable netpoll on enslave failure
Browse files Browse the repository at this point in the history
slave_disable_netpoll() is not called upon enslave failure which would
lead to a memory leak. Call slave_disable_netpoll() after err_detach as
that's the first error path after enabling netpoll on that slave.

Signed-off-by: Nikolay Aleksandrov <[email protected]>
Signed-off-by: David S. Miller <[email protected]>
  • Loading branch information
[email protected] authored and davem330 committed Apr 19, 2013
1 parent 3c5913b commit fc7a72a
Showing 1 changed file with 1 addition and 0 deletions.
1 change: 1 addition & 0 deletions drivers/net/bonding/bond_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -1920,6 +1920,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
write_unlock_bh(&bond->curr_slave_lock);
read_unlock(&bond->lock);
}
slave_disable_netpoll(new_slave);

err_close:
slave_dev->priv_flags &= ~IFF_BONDING;
Expand Down

0 comments on commit fc7a72a

Please sign in to comment.