mirror of https://gitee.com/openkylin/linux.git
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
7c1b9a5aee
commit
39fbb88165
|
@ -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