bonding: disable netpoll on enslave failure
nikolay@redhat.com [Thu, 18 Apr 2013 07:33:37 +0000 (07:33 +0000)]
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>
Signed-off-by: David S. Miller <davem@davemloft.net>

drivers/net/bonding/bond_main.c

index 1137d5e..ae35b28 100644 (file)
@@ -1920,6 +1920,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;