]> git.baikalelectronics.ru Git - kernel.git/commit
libbpf: Free up resources used by inner map definition
authorAndrii Nakryiko <andrii@kernel.org>
Sun, 7 Nov 2021 16:55:14 +0000 (08:55 -0800)
committerAlexei Starovoitov <ast@kernel.org>
Sun, 7 Nov 2021 17:14:15 +0000 (09:14 -0800)
commit0bf69a77eb32e40f13ad6f0e6979caccb3966c13
treed657618b2e32fd4559e0563a05e32c6665a0dd55
parent7b9c8f25d52d4afa647a00c906c4c944909d7d78
libbpf: Free up resources used by inner map definition

It's not enough to just free(map->inner_map), as inner_map itself can
have extra memory allocated, like map name.

Fixes: f2b114b1cdd3 ("libbpf: Add BTF-defined map-in-map support")
Signed-off-by: Andrii Nakryiko <andrii@kernel.org>
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Reviewed-by: Hengqi Chen <hengqi.chen@gmail.com>
Link: https://lore.kernel.org/bpf/20211107165521.9240-3-andrii@kernel.org
tools/lib/bpf/libbpf.c