On Sat, Oct 3, 2020 at 1:55 AM Hangbin Liu <[email protected]> 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 <[email protected]> > Signed-off-by: Hangbin Liu <[email protected]> > ---
LGTM, thanks for the fix! Acked-by: Andrii Nakryiko <[email protected]> > tools/lib/bpf/libbpf.c | 55 ++++++++++++++++++++++++++---------------- > 1 file changed, 34 insertions(+), 21 deletions(-) > [...]
