Re: [PATCHv2 bpf 1/3] libbpf: close map fd if init map slots failed

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On Sat, Oct 3, 2020 at 1:55 AM Hangbin Liu <liuhangbin@xxxxxxxxx> 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.nakryiko@xxxxxxxxx>
> Signed-off-by: Hangbin Liu <liuhangbin@xxxxxxxxx>
> ---

LGTM, thanks for the fix!

Acked-by: Andrii Nakryiko <andrii@xxxxxxxxxx>

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

[...]



[Index of Archives]     [Linux Samsung SoC]     [Linux Rockchip SoC]     [Linux Actions SoC]     [Linux for Synopsys ARC Processors]     [Linux NFS]     [Linux NILFS]     [Linux USB Devel]     [Video for Linux]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]


  Powered by Linux