libbpf: Fix perf_buffer__free() API for sparse allocs
commitf7d9b5bafe4e611212af8e9053de196b78cd1af0
authorEelco Chaudron <echaudro@redhat.com>
Wed, 27 May 2020 08:42:00 +0000 (27 10:42 +0200)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 22 Jun 2020 07:32:53 +0000 (22 09:32 +0200)
treefffed7370e4ac7987d6f1f728d3b578c16e703e6
parentc239b0d1583f9d9656116cf95011e8fceaa98d30
libbpf: Fix perf_buffer__free() API for sparse allocs

[ Upstream commit 601b05ca6edb0422bf6ce313fbfd55ec7bbbc0fd ]

In case the cpu_bufs are sparsely allocated they are not all
free'ed. These changes will fix this.

Fixes: fb84b8224655 ("libbpf: add perf buffer API")
Signed-off-by: Eelco Chaudron <echaudro@redhat.com>
Signed-off-by: Daniel Borkmann <daniel@iogearbox.net>
Acked-by: Andrii Nakryiko <andriin@fb.com>
Link: https://lore.kernel.org/bpf/159056888305.330763.9684536967379110349.stgit@ebuild
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
tools/lib/bpf/libbpf.c