summaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
authorSean Young <sean@mess.org>2018-07-04 16:57:58 +0200
committerMauro Carvalho Chehab <mchehab+samsung@kernel.org>2018-07-13 17:07:29 +0200
commit39fbb88165b2bbbc77ea7acab5f10632a31526e6 (patch)
tree9a19d89f580e4b9a9bd7e2497f3e6975b68b37c8 /drivers
parentmedia: exynos4-is: Prevent NULL pointer dereference in __isp_video_try_fmt() (diff)
downloadlinux-39fbb88165b2bbbc77ea7acab5f10632a31526e6.tar.xz
linux-39fbb88165b2bbbc77ea7acab5f10632a31526e6.zip
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')
-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;