Skip to content

Commit 5199dfe

Browse files
edumazetdavem330
authored andcommitted
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 <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 57b354e commit 5199dfe

File tree

1 file changed

+3
-17
lines changed

1 file changed

+3
-17
lines changed

arch/sparc/net/bpf_jit_comp.c

Lines changed: 3 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -785,9 +785,7 @@ cond_branch: f_offset = addrs[i + filter[i].jf];
785785
break;
786786
}
787787
if (proglen == oldproglen) {
788-
image = module_alloc(max_t(unsigned int,
789-
proglen,
790-
sizeof(struct work_struct)));
788+
image = module_alloc(proglen);
791789
if (!image)
792790
goto out;
793791
}
@@ -806,20 +804,8 @@ cond_branch: f_offset = addrs[i + filter[i].jf];
806804
return;
807805
}
808806

809-
static void jit_free_defer(struct work_struct *arg)
810-
{
811-
module_free(NULL, arg);
812-
}
813-
814-
/* run from softirq, we must use a work_struct to call
815-
* module_free() from process context
816-
*/
817807
void bpf_jit_free(struct sk_filter *fp)
818808
{
819-
if (fp->bpf_func != sk_run_filter) {
820-
struct work_struct *work = (struct work_struct *)fp->bpf_func;
821-
822-
INIT_WORK(work, jit_free_defer);
823-
schedule_work(work);
824-
}
809+
if (fp->bpf_func != sk_run_filter)
810+
module_free(NULL, fp->bpf_func);
825811
}

0 commit comments

Comments
 (0)