diff --git a/kernel/bpf/btf.c b/kernel/bpf/btf.c index 8c684a0e1c4b..9f9996cdb6e2 100644 --- a/kernel/bpf/btf.c +++ b/kernel/bpf/btf.c @@ -7987,6 +7987,7 @@ int bpf_core_apply(struct bpf_core_ctx *ctx, const struct bpf_core_relo *relo, if (!type) { bpf_log(ctx->log, "relo #%u: bad type id %u\n", relo_idx, relo->type_id); + kfree(specs); return -EINVAL; }