aboutsummaryrefslogtreecommitdiffstats
path: root/arch/sparc
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2013-05-17 08:12:34 -0400
committerDavid S. Miller <davem@davemloft.net>2013-05-17 21:27:52 -0400
commit5199dfe531db19f3ac76542753849877e9854441 (patch)
treed5a8dec2dfa7c1a185db3cca68604c9c173fb40e /arch/sparc
parent57b354e66b67c4c72468a26d4313d1217ef32e17 (diff)
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 <edumazet@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'arch/sparc')
-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}