From: Hillf Danton Date: Fri, 10 Dec 2010 18:54:11 +0000 (+0000) Subject: bonding: Fix slave selection bug. X-Git-Tag: firefly_0821_release~9833^2~71^2^2~87 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=04e3fa3f82bc7344115908275152128175adb37f;p=firefly-linux-kernel-4.4.55.git 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 Signed-off-by: David S. Miller Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/net/bonding/bonding.h b/drivers/net/bonding/bonding.h index c6fdd851579a..c867cf901f9f 100644 --- a/drivers/net/bonding/bonding.h +++ b/drivers/net/bonding/bonding.h @@ -240,11 +240,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)