summaryrefslogtreecommitdiff
path: root/drivers/net
diff options
context:
space:
mode:
authorHillf Danton <dhillf@gmail.com>2010-12-10 18:54:11 +0000
committerAK <andi@firstfloor.org>2011-02-06 11:03:37 -0800
commitf69a92aa29a6c15ccad53832a55c1418568f5977 (patch)
tree5b2e46bd978b9a9646ee64476903b2e7ae97bbd4 /drivers/net
parentb89a67e20a5ea68eb607d38c7eb2cf78b29f897f (diff)
bonding: Fix slave selection bug.
[ Upstream commit af3e5bd5f650163c2e12297f572910a1af1b8236 ] 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> Signed-off-by: David S. Miller <davem@davemloft.net> Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de> Signed-off-by: Andi Kleen <ak@linux.intel.com>
Diffstat (limited to 'drivers/net')
-rw-r--r--drivers/net/bonding/bonding.h4
1 files changed, 2 insertions, 2 deletions
diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h
index 2aa336720591..35cf49144249 100644
--- a/drivers/net/bonding/bonding.h
+++ b/drivers/net/bonding/bonding.h
@@ -235,11 +235,11 @@ static inline struct slave *bond_get_slave_by_dev(struct bonding *bond, struct n
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)