[PATCH 047/118] bonding: IFF_BONDING is not stripped on enslave failure

From: Luis Henriques
Date: Tue May 07 2013 - 10:10:35 EST


3.5.7.12 -stable review patch. If anyone has any objections, please let me know.

------------------

From: "nikolay@xxxxxxxxxx" <nikolay@xxxxxxxxxx>

commit b6a5a7b9a528a8b4c8bec940b607c5dd9102b8cc upstream.

While enslaving a new device and after IFF_BONDING flag is set, in case
of failure it is not stripped from the device's priv_flags while
cleaning up, which could lead to other problems.
Cleaning at err_close because the flag is set after dev_open().

v2: no change

Signed-off-by: Nikolay Aleksandrov <nikolay@xxxxxxxxxx>
Signed-off-by: David S. Miller <davem@xxxxxxxxxxxxx>
Signed-off-by: Luis Henriques <luis.henriques@xxxxxxxxxxxxx>
---
drivers/net/bonding/bond_main.c | 1 +
1 file changed, 1 insertion(+)

diff --git a/drivers/net/bonding/bond_main.c b/drivers/net/bonding/bond_main.c
index 5fc31a1..1e1ae64 100644
--- a/drivers/net/bonding/bond_main.c
+++ b/drivers/net/bonding/bond_main.c
@@ -1897,6 +1897,7 @@ err_detach:
write_unlock_bh(&bond->lock);

err_close:
+ slave_dev->priv_flags &= ~IFF_BONDING;
dev_close(slave_dev);

err_unset_master:
--
1.8.1.2

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/