Skip to content

Commit

Permalink
Rework ptr access to avoid false array-index-out-of-bounds errors
Browse files Browse the repository at this point in the history
  • Loading branch information
cardigliano committed Jul 26, 2024
1 parent 11b2463 commit ad9ed9e
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
2 changes: 1 addition & 1 deletion drivers/intel/iavf/iavf-4.9.5-zc/src/iavf_main.c
Original file line number Diff line number Diff line change
Expand Up @@ -4512,7 +4512,7 @@ static int iavf_parse_cls_flower(struct iavf_adapter *adapter,
BIT(FLOW_DISSECTOR_KEY_ENC_KEYID) |
#endif /* HAVE_TC_FLOWER_ENC */
BIT(FLOW_DISSECTOR_KEY_PORTS))) {
dev_err(&adapter->pdev->dev, "Unsupported key used: 0x%llx\n",
dev_err(&adapter->pdev->dev, "Unsupported key used: 0x%x\n",
dissector->used_keys);
return -EOPNOTSUPP;
}
Expand Down
6 changes: 4 additions & 2 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 @@ -995,15 +995,17 @@ void iavf_add_ether_addrs(struct iavf_adapter *adapter)
veal->num_elements = count;
i = 0;
list_for_each_entry(f, &adapter->mac_filter_list, list) {
struct virtchnl_ether_addr *ether_addr_array = &veal->list[0];

if (i == count)
break;
if (is_primary && !(f->is_primary && f->add))
continue;
if (!f->add)
continue;
ether_addr_copy(veal->list[i].addr,
ether_addr_copy(ether_addr_array[i].addr,
f->macaddr);
iavf_set_mac_addr_type(&veal->list[i], f);
iavf_set_mac_addr_type(&ether_addr_array[i], f);
f->add = false;
i++;
}
Expand Down

0 comments on commit ad9ed9e

Please sign in to comment.