Skip to content

Commit

Permalink
qlcnic: fix mac address mgmt
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Amit Kumar Salecha authored and David S. Miller committed Jun 23, 2010
1 parent 900c6cf commit 42f65cb
Showing 1 changed file with 8 additions and 3 deletions.
11 changes: 8 additions & 3 deletions drivers/net/qlcnic/qlcnic_hw.c
Original file line number Diff line number Diff line change
Expand Up @@ -413,10 +413,15 @@ static int qlcnic_nic_add_mac(struct qlcnic_adapter *adapter, u8 *addr)
return -ENOMEM;
}
memcpy(cur->mac_addr, addr, ETH_ALEN);
list_add_tail(&cur->list, &adapter->mac_list);

return qlcnic_sre_macaddr_change(adapter,
cur->mac_addr, QLCNIC_MAC_ADD);
if (qlcnic_sre_macaddr_change(adapter,
cur->mac_addr, QLCNIC_MAC_ADD)) {
kfree(cur);
return -EIO;
}

list_add_tail(&cur->list, &adapter->mac_list);
return 0;
}

void qlcnic_set_multi(struct net_device *netdev)
Expand Down

0 comments on commit 42f65cb

Please sign in to comment.