Skip to content

Commit

Permalink
ebpf_adjust_value_pointer check is redundant (#2814)
Browse files Browse the repository at this point in the history
Signed-off-by: Alan Jowett <[email protected]>
Co-authored-by: Alan Jowett <[email protected]>
  • Loading branch information
Alan-Jowett and Alan Jowett authored Sep 8, 2023
1 parent cf0ff81 commit 01cb25d
Showing 1 changed file with 0 additions and 4 deletions.
4 changes: 0 additions & 4 deletions libs/execution_context/ebpf_maps.c
Original file line number Diff line number Diff line change
Expand Up @@ -1526,17 +1526,13 @@ static ebpf_result_t
_ebpf_adjust_value_pointer(_In_ const ebpf_map_t* map, _Inout_ uint8_t** value)
{
uint32_t current_cpu;
uint32_t max_cpu = map->ebpf_map_definition.value_size / EBPF_PAD_8(map->original_value_size);

if (!(ebpf_map_metadata_tables[map->ebpf_map_definition.type].per_cpu)) {
return EBPF_SUCCESS;
}

current_cpu = ebpf_get_current_cpu();

if (current_cpu > max_cpu) {
return EBPF_INVALID_ARGUMENT;
}
(*value) += EBPF_PAD_8((size_t)map->original_value_size) * current_cpu;
return EBPF_SUCCESS;
}
Expand Down

0 comments on commit 01cb25d

Please sign in to comment.