diff options
author | Daniel Borkmann <dborkman@redhat.com> | 2013-05-20 04:05:50 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-05-20 17:03:50 -0400 |
commit | ed900ffb73e3ab154dff1ae20a2393f24da728df (patch) | |
tree | 08063189ce3fd260661a763413f68ca93fe149df /arch/powerpc/net/bpf_jit_comp.c | |
parent | 71cea17ed39fdf1c0634f530ddc6a2c2fc601c2b (diff) |
ppc: bpf_jit: can call module_free() from any context
Followup patch on module_free()/vfree() that takes care of the rest, so
no longer this workaround with work_struct is needed.
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Matt Evans <matt@ozlabs.org>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/powerpc/net/bpf_jit_comp.c')
-rw-r--r-- | arch/powerpc/net/bpf_jit_comp.c | 19 |
1 files changed, 3 insertions, 16 deletions
diff --git a/arch/powerpc/net/bpf_jit_comp.c b/arch/powerpc/net/bpf_jit_comp.c index c427ae36374a..bf56e33f8257 100644 --- a/arch/powerpc/net/bpf_jit_comp.c +++ b/arch/powerpc/net/bpf_jit_comp.c | |||
@@ -650,8 +650,7 @@ void bpf_jit_compile(struct sk_filter *fp) | |||
650 | 650 | ||
651 | proglen = cgctx.idx * 4; | 651 | proglen = cgctx.idx * 4; |
652 | alloclen = proglen + FUNCTION_DESCR_SIZE; | 652 | alloclen = proglen + FUNCTION_DESCR_SIZE; |
653 | image = module_alloc(max_t(unsigned int, alloclen, | 653 | image = module_alloc(alloclen); |
654 | sizeof(struct work_struct))); | ||
655 | if (!image) | 654 | if (!image) |
656 | goto out; | 655 | goto out; |
657 | 656 | ||
@@ -688,20 +687,8 @@ out: | |||
688 | return; | 687 | return; |
689 | } | 688 | } |
690 | 689 | ||
691 | static void jit_free_defer(struct work_struct *arg) | ||
692 | { | ||
693 | module_free(NULL, arg); | ||
694 | } | ||
695 | |||
696 | /* run from softirq, we must use a work_struct to call | ||
697 | * module_free() from process context | ||
698 | */ | ||
699 | void bpf_jit_free(struct sk_filter *fp) | 690 | void bpf_jit_free(struct sk_filter *fp) |
700 | { | 691 | { |
701 | if (fp->bpf_func != sk_run_filter) { | 692 | if (fp->bpf_func != sk_run_filter) |
702 | struct work_struct *work = (struct work_struct *)fp->bpf_func; | 693 | module_free(NULL, fp->bpf_func); |
703 | |||
704 | INIT_WORK(work, jit_free_defer); | ||
705 | schedule_work(work); | ||
706 | } | ||
707 | } | 694 | } |