Skip to content

Commit

Permalink
fix build failure
Browse files Browse the repository at this point in the history
  • Loading branch information
saxena-anurag committed Oct 2, 2024
1 parent ac9dad1 commit a14710a
Showing 1 changed file with 4 additions and 2 deletions.
6 changes: 4 additions & 2 deletions libs/execution_context/ebpf_maps.c
Original file line number Diff line number Diff line change
Expand Up @@ -2868,7 +2868,7 @@ ebpf_map_push_entry(_Inout_ ebpf_map_t* map, size_t value_size, _In_reads_(value
_Must_inspect_result_ ebpf_result_t
ebpf_map_pop_entry(_Inout_ ebpf_map_t* map, size_t value_size, _Out_writes_(value_size) uint8_t* value, int flags)
{
uint8_t* return_value;
uint8_t* return_value = NULL;
if (!(flags & EBPF_MAP_FLAG_HELPER) && (value_size != map->ebpf_map_definition.value_size)) {
return EBPF_INVALID_ARGUMENT;
}
Expand All @@ -2888,14 +2888,15 @@ ebpf_map_pop_entry(_Inout_ ebpf_map_t* map, size_t value_size, _Out_writes_(valu
return result;
}

__analysis_assume(return_value != NULL);
memcpy(value, return_value, map->ebpf_map_definition.value_size);
return EBPF_SUCCESS;
}

_Must_inspect_result_ ebpf_result_t
ebpf_map_peek_entry(_Inout_ ebpf_map_t* map, size_t value_size, _Out_writes_(value_size) uint8_t* value, int flags)
{
uint8_t* return_value;
uint8_t* return_value = NULL;
if (!(flags & EBPF_MAP_FLAG_HELPER) && (value_size != map->ebpf_map_definition.value_size)) {
return EBPF_INVALID_ARGUMENT;
}
Expand All @@ -2915,6 +2916,7 @@ ebpf_map_peek_entry(_Inout_ ebpf_map_t* map, size_t value_size, _Out_writes_(val
return result;
}

__analysis_assume(return_value != NULL);
memcpy(value, return_value, map->ebpf_map_definition.value_size);
return EBPF_SUCCESS;
}
Expand Down

0 comments on commit a14710a

Please sign in to comment.