diff options
author | Eric Dumazet <edumazet@google.com> | 2013-05-17 12:12:34 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-05-17 18:27:52 -0700 |
commit | 5199dfe531db19f3ac76542753849877e9854441 (patch) | |
tree | d5a8dec2dfa7c1a185db3cca68604c9c173fb40e /arch/sparc | |
parent | 57b354e66b67c4c72468a26d4313d1217ef32e17 (diff) | |
download | linux-5199dfe531db19f3ac76542753849877e9854441.tar.bz2 |
sparc: bpf_jit_comp: can call module_free() from any context
module_free()/vfree() takes care of details, we no longer need a wrapper
and a work_struct.
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc')
-rw-r--r-- | arch/sparc/net/bpf_jit_comp.c | 20 |
1 files changed, 3 insertions, 17 deletions
diff --git a/arch/sparc/net/bpf_jit_comp.c b/arch/sparc/net/bpf_jit_comp.c index d36a85ebb5e0..9c7be59e6f5a 100644 --- a/arch/sparc/net/bpf_jit_comp.c +++ b/arch/sparc/net/bpf_jit_comp.c @@ -785,9 +785,7 @@ cond_branch: f_offset = addrs[i + filter[i].jf]; break; } if (proglen == oldproglen) { - image = module_alloc(max_t(unsigned int, - proglen, - sizeof(struct work_struct))); + image = module_alloc(proglen); if (!image) goto out; } @@ -806,20 +804,8 @@ out: return; } -static void jit_free_defer(struct work_struct *arg) -{ - module_free(NULL, arg); -} - -/* run from softirq, we must use a work_struct to call - * module_free() from process context - */ void bpf_jit_free(struct sk_filter *fp) { - if (fp->bpf_func != sk_run_filter) { - struct work_struct *work = (struct work_struct *)fp->bpf_func; - - INIT_WORK(work, jit_free_defer); - schedule_work(work); - } + if (fp->bpf_func != sk_run_filter) + module_free(NULL, fp->bpf_func); } |