Commit aafc787e authored by Daniel Borkmann's avatar Daniel Borkmann Committed by David S. Miller
Browse files

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: default avatarDaniel Borkmann <>
Cc: Al Viro <>
Cc: Mircea Gherzan <>
Signed-off-by: default avatarDavid S. Miller <>
parent ed900ffb
......@@ -900,8 +900,7 @@ void bpf_jit_compile(struct sk_filter *fp)
alloc_size = 4 * ctx.idx; = module_alloc(max(sizeof(struct work_struct),
alloc_size)); = module_alloc(alloc_size);
if (unlikely( == NULL))
goto out;
......@@ -927,19 +926,8 @@ void bpf_jit_compile(struct sk_filter *fp)
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);
if (fp->bpf_func != sk_run_filter)
module_free(NULL, fp->bpf_func);
Supports Markdown
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