Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit fc7a72a

Browse files
nikolay@redhat.comdavem330
authored andcommitted
bonding: disable netpoll on enslave failure
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]>
1 parent 3c5913b commit fc7a72a

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/net/bonding/bond_main.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1920,6 +1920,7 @@ int bond_enslave(struct net_device *bond_dev, struct net_device *slave_dev)
19201920
write_unlock_bh(&bond->curr_slave_lock);
19211921
read_unlock(&bond->lock);
19221922
}
1923+
slave_disable_netpoll(new_slave);
19231924

19241925
err_close:
19251926
slave_dev->priv_flags &= ~IFF_BONDING;

0 commit comments

Comments
 (0)