mirror of
https://mirrors.bfsu.edu.cn/git/linux.git
synced 2024-12-05 18:14:07 +08:00
media: bpf: ensure bpf program is freed on detach
Currently we are leaking bpf programs when they are detached from the lirc device; the refcount never reaches zero. Signed-off-by: Sean Young <sean@mess.org> Signed-off-by: Mauro Carvalho Chehab <mchehab+samsung@kernel.org>
This commit is contained in:
parent
0ca54b2905
commit
92cab799bb
@ -174,6 +174,7 @@ static int lirc_bpf_detach(struct rc_dev *rcdev, struct bpf_prog *prog)
|
||||
|
||||
rcu_assign_pointer(raw->progs, new_array);
|
||||
bpf_prog_array_free(old_array);
|
||||
bpf_prog_put(prog);
|
||||
unlock:
|
||||
mutex_unlock(&ir_raw_handler_lock);
|
||||
return ret;
|
||||
|
Loading…
Reference in New Issue
Block a user