Commit 1144ab9b authored by Andrii Nakryiko's avatar Andrii Nakryiko Committed by Daniel Borkmann
Browse files

tools/resolve_btf_ids: Close ELF file on error



Fix one case where we don't do explicit clean up.

Fixes: fbbb68de ("bpf: Add resolve_btfids tool to resolve BTF IDs in ELF object")
Signed-off-by: default avatarAndrii Nakryiko <andrii@kernel.org>
Signed-off-by: default avatarDaniel Borkmann <daniel@iogearbox.net>
Link: https://lore.kernel.org/bpf/20211124002325.1737739-2-andrii@kernel.org
parent 2fe256a4
Loading
Loading
Loading
Loading
+3 −2
Original line number Diff line number Diff line
@@ -730,7 +730,8 @@ int main(int argc, const char **argv)
	if (obj.efile.idlist_shndx == -1 ||
	    obj.efile.symbols_shndx == -1) {
		pr_debug("Cannot find .BTF_ids or symbols sections, nothing to do\n");
		return 0;
		err = 0;
		goto out;
	}

	if (symbols_collect(&obj))