Commit 1eeb7478 authored by Heiko Carstens's avatar Heiko Carstens Committed by Martin Schwidefsky

s390/bpf,jit: call module_free() from any context

The workqueue workaround is no longer needed. Same as 5199dfe5
"sparc: bpf_jit_comp: can call module_free() from any context".
Signed-off-by: default avatarHeiko Carstens <heiko.carstens@de.ibm.com>
Signed-off-by: default avatarMartin Schwidefsky <schwidefsky@de.ibm.com>
parent dae7fd42
...@@ -772,8 +772,7 @@ void bpf_jit_compile(struct sk_filter *fp) ...@@ -772,8 +772,7 @@ void bpf_jit_compile(struct sk_filter *fp)
} else if (jit.prg == cjit.prg && jit.lit == cjit.lit) { } else if (jit.prg == cjit.prg && jit.lit == cjit.lit) {
prg_len = jit.prg - jit.start; prg_len = jit.prg - jit.start;
lit_len = jit.lit - jit.mid; lit_len = jit.lit - jit.mid;
size = max_t(unsigned long, prg_len + lit_len, size = prg_len + lit_len;
sizeof(struct work_struct));
if (size >= BPF_SIZE_MAX) if (size >= BPF_SIZE_MAX)
goto out; goto out;
jit.start = module_alloc(size); jit.start = module_alloc(size);
...@@ -804,21 +803,8 @@ void bpf_jit_compile(struct sk_filter *fp) ...@@ -804,21 +803,8 @@ void bpf_jit_compile(struct sk_filter *fp)
kfree(addrs); kfree(addrs);
} }
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) void bpf_jit_free(struct sk_filter *fp)
{ {
struct work_struct *work; if (fp->bpf_func != sk_run_filter)
module_free(NULL, fp->bpf_func);
if (fp->bpf_func == sk_run_filter)
return;
work = (struct work_struct *)fp->bpf_func;
INIT_WORK(work, jit_free_defer);
schedule_work(work);
} }
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment