diff mbox

fix bug in Ethernet Channel Bonding Driver

Message ID AANLkTiksuf0ZDWyjH6ec9rSRoG+5ZdakA-Tha9MXLvy+@mail.gmail.com
State Accepted, archived
Delegated to: David Miller
Headers show

Commit Message

Hillf Danton Dec. 11, 2010, 4:54 a.m. UTC
The returned slave is incorrect, if the net device under check is not
charged yet by the master.

Signed-off-by: Hillf Danton <dhillf@gmail.com>
---

--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Comments

David Miller Dec. 16, 2010, 8:24 p.m. UTC | #1
From: Hillf Danton <dhillf@gmail.com>
Date: Sat, 11 Dec 2010 12:54:11 +0800

> The returned slave is incorrect, if the net device under check is not
> charged yet by the master.
> 
> Signed-off-by: Hillf Danton <dhillf@gmail.com>

Applied, thank you.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html
diff mbox

Patch

--- a/drivers/net/bonding/bonding.h	2010-11-01 19:54:12.000000000 +0800
+++ b/drivers/net/bonding/bonding.h	2010-12-11 12:48:00.000000000 +0800
@@ -273,11 +273,11 @@  static inline struct slave *bond_get_sla

 	bond_for_each_slave(bond, slave, i) {
 		if (slave->dev == slave_dev) {
-			break;
+			return slave;
 		}
 	}

-	return slave;
+	return 0;
 }

 static inline struct bonding *bond_get_bond_by_slave(struct slave *slave)