On Sat, Oct 3, 2020 at 1:55 AM Hangbin Liu <liuhang...@gmail.com> wrote:
>
> Previously we forgot to close the map fd if bpf_map_update_elem()
> failed during map slot init, which will leak map fd.
>
> Let's move map slot initialization to new function init_map_slots() to
> simplify the code. And close the map fd if init slot failed.
>
> Reported-by: Andrii Nakryiko <andrii.nakry...@gmail.com>
> Signed-off-by: Hangbin Liu <liuhang...@gmail.com>
> ---

LGTM, thanks for the fix!

Acked-by: Andrii Nakryiko <and...@kernel.org>

>  tools/lib/bpf/libbpf.c | 55 ++++++++++++++++++++++++++----------------
>  1 file changed, 34 insertions(+), 21 deletions(-)
>

[...]

Reply via email to