tc: act_bpf: fix memory leak
prog->bpf_ops is populated when act_bpf is used with classic BPF and prog->bpf_name is optionally used with extended BPF. Fix memory leak when act_bpf is released. Fixes:d23b8ad8ab
("tc: add BPF based action") Fixes:a8cb5f556b
("act_bpf: add initial eBPF support for actions") Acked-by: Daniel Borkmann <daniel@iogearbox.net> Signed-off-by: Alexei Starovoitov <ast@plumgrid.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
c0afd9ce4d
commit
ddf06c1e56
|
@ -339,6 +339,9 @@ static void tcf_bpf_cleanup(struct tc_action *act, int bind)
|
|||
bpf_prog_put(prog->filter);
|
||||
else
|
||||
bpf_prog_destroy(prog->filter);
|
||||
|
||||
kfree(prog->bpf_ops);
|
||||
kfree(prog->bpf_name);
|
||||
}
|
||||
|
||||
static struct tc_action_ops act_bpf_ops __read_mostly = {
|
||||
|
|
Loading…
Reference in New Issue