@@ -681,6 +681,7 @@ static int ixgbe_set_vf_macvlan(struct ixgbe_adapter *adapter,
{
struct list_head *pos;
struct vf_macvlans *entry;
+ s32 retval = 0;
if (index <= 1) {
list_for_each(pos, &adapter->vf_mvs.l) {
@@ -721,14 +722,15 @@ static int ixgbe_set_vf_macvlan(struct ixgbe_adapter *adapter,
if (!entry || !entry->free)
return -ENOSPC;
- entry->free = false;
- entry->is_macvlan = true;
- entry->vf = vf;
- memcpy(entry->vf_macvlan, mac_addr, ETH_ALEN);
-
- ixgbe_add_mac_filter(adapter, mac_addr, vf);
+ retval = ixgbe_add_mac_filter(adapter, mac_addr, vf);
+ if (retval >= 0) {
+ entry->free = false;
+ entry->is_macvlan = true;
+ entry->vf = vf;
+ memcpy(entry->vf_macvlan, mac_addr, ETH_ALEN);
+ }
- return 0;
+ return retval;
}
static inline void ixgbe_vf_reset_event(struct ixgbe_adapter *adapter, u32 vf)