bonding:delete a dereference before check

Submitted by Peter Pan(潘卫平) on June 13, 2011, 2:30 p.m.

Details

Message ID 1307975410-13523-1-git-send-email-panweiping3@gmail.com
State Accepted
Delegated to: David Miller
Headers show

Commit Message

Peter Pan(潘卫平) June 13, 2011, 2:30 p.m.
Dan Carpenter found that there was a dereference before a check,
added in 56d00c677de0(bonding:delete lacp_fast from ad_bond_info).

Signed-off-by: Weiping Pan <panweiping3@gmail.com>
---
 drivers/net/bonding/bond_3ad.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)

Comments

Jay Vosburgh June 13, 2011, 10:11 p.m.
Weiping Pan <panweiping3@gmail.com> wrote:

>Dan Carpenter found that there was a dereference before a check,
>added in 56d00c677de0(bonding:delete lacp_fast from ad_bond_info).
>
>Signed-off-by: Weiping Pan <panweiping3@gmail.com>

Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>

	-J

> drivers/net/bonding/bond_3ad.c |    3 +--
> 1 files changed, 1 insertions(+), 2 deletions(-)
>
>diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
>index 6122725..77da2e8 100644
>--- a/drivers/net/bonding/bond_3ad.c
>+++ b/drivers/net/bonding/bond_3ad.c
>@@ -1900,7 +1900,6 @@ void bond_3ad_initialize(struct bonding *bond, u16 tick_resolution)
> int bond_3ad_bind_slave(struct slave *slave)
> {
> 	struct bonding *bond = bond_get_bond_by_slave(slave);
>-	int lacp_fast = bond->params.lacp_fast;
> 	struct port *port;
> 	struct aggregator *aggregator;
>
>@@ -1916,7 +1915,7 @@ int bond_3ad_bind_slave(struct slave *slave)
> 		// port initialization
> 		port = &(SLAVE_AD_INFO(slave).port);
>
>-		ad_initialize_port(port, lacp_fast);
>+		ad_initialize_port(port, bond->params.lacp_fast);
>
> 		port->slave = slave;
> 		port->actor_port_number = SLAVE_AD_INFO(slave).id;
>-- 
>1.7.4.4
--
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
David Miller June 13, 2011, 10:29 p.m.
From: Jay Vosburgh <fubar@us.ibm.com>
Date: Mon, 13 Jun 2011 15:11:01 -0700

> Weiping Pan <panweiping3@gmail.com> wrote:
> 
>>Dan Carpenter found that there was a dereference before a check,
>>added in 56d00c677de0(bonding:delete lacp_fast from ad_bond_info).
>>
>>Signed-off-by: Weiping Pan <panweiping3@gmail.com>
> 
> Signed-off-by: Jay Vosburgh <fubar@us.ibm.com>

Applied, thanks.
--
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

Patch hide | download patch | download mbox

diff --git a/drivers/net/bonding/bond_3ad.c b/drivers/net/bonding/bond_3ad.c
index 6122725..77da2e8 100644
--- a/drivers/net/bonding/bond_3ad.c
+++ b/drivers/net/bonding/bond_3ad.c
@@ -1900,7 +1900,6 @@  void bond_3ad_initialize(struct bonding *bond, u16 tick_resolution)
 int bond_3ad_bind_slave(struct slave *slave)
 {
 	struct bonding *bond = bond_get_bond_by_slave(slave);
-	int lacp_fast = bond->params.lacp_fast;
 	struct port *port;
 	struct aggregator *aggregator;
 
@@ -1916,7 +1915,7 @@  int bond_3ad_bind_slave(struct slave *slave)
 		// port initialization
 		port = &(SLAVE_AD_INFO(slave).port);
 
-		ad_initialize_port(port, lacp_fast);
+		ad_initialize_port(port, bond->params.lacp_fast);
 
 		port->slave = slave;
 		port->actor_port_number = SLAVE_AD_INFO(slave).id;