Skip to contentSkip to conversation

media: bpf: ensure bpf program is freed on detach

PATCH New Sean Young 1 participant 1 message Jul 4, 2018

Subsystems (2)
lore
Share & tools
lore

Sean Young

author maintainer
#0 lore raw

PATCH 1/1 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.

---
 drivers/media/rc/bpf-lirc.c | 1 +
 1 file changed, 1 insertion(+)
drivers/media/rc/bpf-lirc.c +1 -0
index fcfab6635f9c..81b150e5dfdb 100644
@@ -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;
Signature · 1 line
2.17.1