Commit 39fbb881 authored by Sean Young's avatar Sean Young Committed by Mauro Carvalho Chehab

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: default avatarSean Young <sean@mess.org>
Signed-off-by: default avatarMauro Carvalho Chehab <mchehab+samsung@kernel.org>
parent 7c1b9a5a
...@@ -174,6 +174,7 @@ static int lirc_bpf_detach(struct rc_dev *rcdev, struct bpf_prog *prog) ...@@ -174,6 +174,7 @@ static int lirc_bpf_detach(struct rc_dev *rcdev, struct bpf_prog *prog)
rcu_assign_pointer(raw->progs, new_array); rcu_assign_pointer(raw->progs, new_array);
bpf_prog_array_free(old_array); bpf_prog_array_free(old_array);
bpf_prog_put(prog);
unlock: unlock:
mutex_unlock(&ir_raw_handler_lock); mutex_unlock(&ir_raw_handler_lock);
return ret; return ret;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment