aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/sparc/net/bpf_jit_comp.c20
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];
785 break; 785 break;
786 } 786 }
787 if (proglen == oldproglen) { 787 if (proglen == oldproglen) {
788 image = module_alloc(max_t(unsigned int, 788 image = module_alloc(proglen);
789 proglen,
790 sizeof(struct work_struct)));
791 if (!image) 789 if (!image)
792 goto out; 790 goto out;
793 } 791 }
@@ -806,20 +804,8 @@ out:
806 return; 804 return;
807} 805}
808 806
809static 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 */
817void bpf_jit_free(struct sk_filter *fp) 807void bpf_jit_free(struct sk_filter *fp)
818{ 808{
819 if (fp->bpf_func != sk_run_filter) { 809 if (fp->bpf_func != sk_run_filter)
820 struct work_struct *work = (struct work_struct *)fp->bpf_func; 810 module_free(NULL, fp->bpf_func);
821
822 INIT_WORK(work, jit_free_defer);
823 schedule_work(work);
824 }
825} 811}