This patch set fixes the removal of a BTF-defined inner map if the creation of the outer map has failed. This was identified by Andrii in [1]. [1]: https://lore.kernel.org/bpf/CAEf4BzYaQsD6NaEUij6ttDeKYP7oEB0=c0D9_xdAKw6FYb7h1g@xxxxxxxxxxxxxx/ Martynas Pumputis (2): libbpf: fix removal of inner map in bpf_object__create_map selftests/bpf: check inner map deletion tools/lib/bpf/libbpf.c | 5 +- .../bpf/progs/test_map_in_map_invalid.c | 27 +++++++++ tools/testing/selftests/bpf/test_maps.c | 58 ++++++++++++++++++- 3 files changed, 87 insertions(+), 3 deletions(-) create mode 100644 tools/testing/selftests/bpf/progs/test_map_in_map_invalid.c -- 2.32.0