diff options
author | Daniel Borkmann <dborkman@redhat.com> | 2013-05-20 08:05:51 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-05-20 14:03:50 -0700 |
commit | aafc787e41fd8a4d3a4378b028d8d8f8d38d9bb6 (patch) | |
tree | 7b300d6c74c287f5e868d0dcf429a8078dca072d /arch/arm/net | |
parent | ed900ffb73e3ab154dff1ae20a2393f24da728df (diff) | |
download | blackbird-op-linux-aafc787e41fd8a4d3a4378b028d8d8f8d38d9bb6.tar.gz blackbird-op-linux-aafc787e41fd8a4d3a4378b028d8d8f8d38d9bb6.zip |
arm: bpf_jit: can call module_free() from any context
Follow-up on module_free()/vfree() that takes care of the rest, so no
longer this workaround with work_struct needed.
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Cc: Al Viro <viro@zeniv.linux.org.uk>
Cc: Mircea Gherzan <mgherzan@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/arm/net')
-rw-r--r-- | arch/arm/net/bpf_jit_32.c | 18 |
1 files changed, 3 insertions, 15 deletions
diff --git a/arch/arm/net/bpf_jit_32.c b/arch/arm/net/bpf_jit_32.c index 1a643ee8e082..f50d223a0bd3 100644 --- a/arch/arm/net/bpf_jit_32.c +++ b/arch/arm/net/bpf_jit_32.c @@ -900,8 +900,7 @@ void bpf_jit_compile(struct sk_filter *fp) #endif alloc_size = 4 * ctx.idx; - ctx.target = module_alloc(max(sizeof(struct work_struct), - alloc_size)); + ctx.target = module_alloc(alloc_size); if (unlikely(ctx.target == NULL)) goto out; @@ -927,19 +926,8 @@ out: return; } -static void bpf_jit_free_worker(struct work_struct *work) -{ - module_free(NULL, work); -} - void bpf_jit_free(struct sk_filter *fp) { - struct work_struct *work; - - if (fp->bpf_func != sk_run_filter) { - work = (struct work_struct *)fp->bpf_func; - - INIT_WORK(work, bpf_jit_free_worker); - schedule_work(work); - } + if (fp->bpf_func != sk_run_filter) + module_free(NULL, fp->bpf_func); } |