From: Sean Young Date: Wed, 4 Jul 2018 14:57:58 +0000 (-0400) Subject: media: bpf: ensure bpf program is freed on detach X-Git-Url: http://git.lede-project.org./?a=commitdiff_plain;h=39fbb88165b2bbbc77ea7acab5f10632a31526e6;p=openwrt%2Fstaging%2Fblogic.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 Signed-off-by: Mauro Carvalho Chehab --- 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;