aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--arch/arm/net/bpf_jit_32.c18
1 files changed, 3 insertions, 15 deletions
diff --git a/arch/arm/net/bpf_jit_32.c b/arch/arm/net/bpf_jit_32.c
index 1a643ee8e082..f50d223a0bd3 100644
--- a/arch/arm/net/bpf_jit_32.c
+++ b/arch/arm/net/bpf_jit_32.c
@@ -900,8 +900,7 @@ void bpf_jit_compile(struct sk_filter *fp)
900#endif 900#endif
901 901
902 alloc_size = 4 * ctx.idx; 902 alloc_size = 4 * ctx.idx;
903 ctx.target = module_alloc(max(sizeof(struct work_struct), 903 ctx.target = module_alloc(alloc_size);
904 alloc_size));
905 if (unlikely(ctx.target == NULL)) 904 if (unlikely(ctx.target == NULL))
906 goto out; 905 goto out;
907 906
@@ -927,19 +926,8 @@ out:
927 return; 926 return;
928} 927}
929 928
930static void bpf_jit_free_worker(struct work_struct *work)
931{
932 module_free(NULL, work);
933}
934
935void bpf_jit_free(struct sk_filter *fp) 929void bpf_jit_free(struct sk_filter *fp)
936{ 930{
937 struct work_struct *work; 931 if (fp->bpf_func != sk_run_filter)
938 932 module_free(NULL, fp->bpf_func);
939 if (fp->bpf_func != sk_run_filter) {
940 work = (struct work_struct *)fp->bpf_func;
941
942 INIT_WORK(work, bpf_jit_free_worker);
943 schedule_work(work);
944 }
945} 933}