]> git.proxmox.com Git - mirror_ubuntu-kernels.git/commit
bpf: Fix early return in map_check_btf
authorKumar Kartikeya Dwivedi <memxor@gmail.com>
Fri, 18 Nov 2022 01:55:51 +0000 (07:25 +0530)
committerAlexei Starovoitov <ast@kernel.org>
Fri, 18 Nov 2022 03:11:31 +0000 (19:11 -0800)
commitc237bfa5283a562cd5d74dd74b2d9016acd97f45
tree5e252f4eb40b2c1056cc7c6e3f63802979e84c31
parent98b2afc8a67f651ed01fc7d5a7e2528e63dd4e08
bpf: Fix early return in map_check_btf

Instead of returning directly with -EOPNOTSUPP for the timer case, we
need to free the btf_record before returning to userspace.

Fixes: db559117828d ("bpf: Consolidate spin_lock, timer management into btf_record")
Reported-by: Dan Carpenter <error27@gmail.com>
Signed-off-by: Kumar Kartikeya Dwivedi <memxor@gmail.com>
Link: https://lore.kernel.org/r/20221118015614.2013203-2-memxor@gmail.com
Signed-off-by: Alexei Starovoitov <ast@kernel.org>
kernel/bpf/syscall.c