Skip to content

Commit 39fbb88

Browse files
seanyoungmchehab
authored andcommitted
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 <[email protected]> Signed-off-by: Mauro Carvalho Chehab <[email protected]>
1 parent 7c1b9a5 commit 39fbb88

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

drivers/media/rc/bpf-lirc.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -174,6 +174,7 @@ static int lirc_bpf_detach(struct rc_dev *rcdev, struct bpf_prog *prog)
174174

175175
rcu_assign_pointer(raw->progs, new_array);
176176
bpf_prog_array_free(old_array);
177+
bpf_prog_put(prog);
177178
unlock:
178179
mutex_unlock(&ir_raw_handler_lock);
179180
return ret;

0 commit comments

Comments
 (0)