Skip to content

Commit

Permalink
Rework ptr access to avoid false array-index-out-of-bounds errors (3)
Browse files Browse the repository at this point in the history
  • Loading branch information
cardigliano committed Jul 26, 2024
1 parent a842764 commit cff2c5a
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions drivers/intel/iavf/iavf-4.9.5-zc/src/iavf_virtchnl.c
Original file line number Diff line number Diff line change
Expand Up @@ -1077,13 +1077,14 @@ void iavf_del_ether_addrs(struct iavf_adapter *adapter)
veal->num_elements = count;
list_for_each_entry_safe(f, ftmp, &adapter->mac_filter_list, list) {
if (f->remove) {
ether_addr_copy(veal->list[i].addr, f->macaddr);
iavf_set_mac_addr_type(&veal->list[i], f);
struct virtchnl_ether_addr *ether_addr_array = &veal->list[0];
if (i == count)
break;
ether_addr_copy(ether_addr_array[i].addr, f->macaddr);
iavf_set_mac_addr_type(&ether_addr_array[i], f);
i++;
list_del(&f->list);
kfree(f);
if (i == count)
break;
}
}
if (!more)
Expand Down

0 comments on commit cff2c5a

Please sign in to comment.