Patchwork [4/5] bonding: disable netpoll on enslave failure

login
register
mail settings
Submitter Nikolay Aleksandrov
Date April 18, 2013, 2:34 p.m.
Message ID <1366295697-31037-5-git-send-email-nikolay@redhat.com>
Download mbox | patch
Permalink /patch/237671/
State Superseded
Delegated to: David Miller
Headers show

Comments

Nikolay Aleksandrov - April 18, 2013, 2:34 p.m.
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 <nikolay@redhat.com>
---
 drivers/net/bonding/bond_main.c | 1 +
 1 file changed, 1 insertion(+)

Patch

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index a04a018..62bfde7 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1918,6 +1918,7 @@  err_detach:
 		write_unlock_bh(&bond->curr_slave_lock);
 		read_unlock(&bond->lock);
 	}
+	slave_disable_netpoll(new_slave);
 
 err_close:
 	slave_dev->priv_flags &= ~IFF_BONDING;