summaryrefslogtreecommitdiff
path: root/drivers/media/rc
diff options
context:
space:
mode:
authorSean Young <sean@mess.org>2018-07-04 10:57:58 -0400
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2018-07-26 08:39:18 -0400
commit92cab799bbc6fa1fca84bd1692285a5f926c17e9 (patch)
tree041e50983017f651d2f4937d1fb51b1947c32aca /drivers/media/rc
parent0ca54b29054151b7a52cbb8904732280afe5a302 (diff)
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>
Diffstat (limited to 'drivers/media/rc')
-rw-r--r--drivers/media/rc/bpf-lirc.c1
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/media/rc/bpf-lirc.c b/drivers/media/rc/bpf-lirc.c
index 40826bba06b6..55400317ec53 100644
--- a/drivers/media/rc/bpf-lirc.c
+++ b/drivers/media/rc/bpf-lirc.c
@@ -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;