]> git.baikalelectronics.ru Git - kernel.git/commitdiff
sparc: bpf_jit_comp: can call module_free() from any context
authorEric Dumazet <edumazet@google.com>
Fri, 17 May 2013 12:12:34 +0000 (12:12 +0000)
committerDavid S. Miller <davem@davemloft.net>
Sat, 18 May 2013 01:27:52 +0000 (18:27 -0700)
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>
arch/sparc/net/bpf_jit_comp.c

index d36a85ebb5e027c38929c2a5a8f9e7be772984b9..9c7be59e6f5ad3ad360facd10c6a2c35fd3bde75 100644 (file)
@@ -785,9 +785,7 @@ cond_branch:                        f_offset = addrs[i + filter[i].jf];
                        break;
                }
                if (proglen == oldproglen) {
-                       image = module_alloc(max_t(unsigned int,
-                                                  proglen,
-                                                  sizeof(struct work_struct)));
+                       image = module_alloc(proglen);
                        if (!image)
                                goto out;
                }
@@ -806,20 +804,8 @@ out:
        return;
 }
 
-static void jit_free_defer(struct work_struct *arg)
-{
-       module_free(NULL, arg);
-}
-
-/* run from softirq, we must use a work_struct to call
- * module_free() from process context
- */
 void bpf_jit_free(struct sk_filter *fp)
 {
-       if (fp->bpf_func != sk_run_filter) {
-               struct work_struct *work = (struct work_struct *)fp->bpf_func;
-
-               INIT_WORK(work, jit_free_defer);
-               schedule_work(work);
-       }
+       if (fp->bpf_func != sk_run_filter)
+               module_free(NULL, fp->bpf_func);
 }