diff options
author | Amit Kumar Salecha <amit.salecha@qlogic.com> | 2010-06-21 23:19:00 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-06-23 16:16:29 -0400 |
commit | 42f65cbad4168958dff8a307bfe4b528409951d3 (patch) | |
tree | 201468cfbf275a8849b853b1e5c920ef5b3f767f /drivers/net/qlcnic | |
parent | 900c6cfffac668199aaa30a20e31d07602f8a8ce (diff) |
qlcnic: fix mac address mgmt
We first add mac address in driver local list and then send command to
fw to add same. There are checks in driver to ensure send command doesn't fail
before adding mac address in local list.
But instead fix should be:
Add mac address in fw and if it succeeds, add it in driver local list.
Signed-off-by: Amit Kumar Salecha <amit.salecha@qlogic.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/qlcnic')
-rw-r--r-- | drivers/net/qlcnic/qlcnic_hw.c | 11 |
1 files changed, 8 insertions, 3 deletions
diff --git a/drivers/net/qlcnic/qlcnic_hw.c b/drivers/net/qlcnic/qlcnic_hw.c index 10ba72302fc9..ad124254b6a9 100644 --- a/drivers/net/qlcnic/qlcnic_hw.c +++ b/drivers/net/qlcnic/qlcnic_hw.c | |||
@@ -413,10 +413,15 @@ static int qlcnic_nic_add_mac(struct qlcnic_adapter *adapter, u8 *addr) | |||
413 | return -ENOMEM; | 413 | return -ENOMEM; |
414 | } | 414 | } |
415 | memcpy(cur->mac_addr, addr, ETH_ALEN); | 415 | memcpy(cur->mac_addr, addr, ETH_ALEN); |
416 | list_add_tail(&cur->list, &adapter->mac_list); | ||
417 | 416 | ||
418 | return qlcnic_sre_macaddr_change(adapter, | 417 | if (qlcnic_sre_macaddr_change(adapter, |
419 | cur->mac_addr, QLCNIC_MAC_ADD); | 418 | cur->mac_addr, QLCNIC_MAC_ADD)) { |
419 | kfree(cur); | ||
420 | return -EIO; | ||
421 | } | ||
422 | |||
423 | list_add_tail(&cur->list, &adapter->mac_list); | ||
424 | return 0; | ||
420 | } | 425 | } |
421 | 426 | ||
422 | void qlcnic_set_multi(struct net_device *netdev) | 427 | void qlcnic_set_multi(struct net_device *netdev) |