aboutsummaryrefslogtreecommitdiffstats
path: root/kernel/bpf/core.c
diff options
context:
space:
mode:
Diffstat (limited to 'kernel/bpf/core.c')
-rw-r--r--kernel/bpf/core.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/kernel/bpf/core.c b/kernel/bpf/core.c
index 80864712d2c4..334b1bdd572c 100644
--- a/kernel/bpf/core.c
+++ b/kernel/bpf/core.c
@@ -92,6 +92,7 @@ struct bpf_prog *bpf_prog_alloc(unsigned int size, gfp_t gfp_extra_flags)
92 92
93 fp->pages = size / PAGE_SIZE; 93 fp->pages = size / PAGE_SIZE;
94 fp->aux = aux; 94 fp->aux = aux;
95 fp->aux->prog = fp;
95 96
96 return fp; 97 return fp;
97} 98}
@@ -116,6 +117,7 @@ struct bpf_prog *bpf_prog_realloc(struct bpf_prog *fp_old, unsigned int size,
116 117
117 memcpy(fp, fp_old, fp_old->pages * PAGE_SIZE); 118 memcpy(fp, fp_old, fp_old->pages * PAGE_SIZE);
118 fp->pages = size / PAGE_SIZE; 119 fp->pages = size / PAGE_SIZE;
120 fp->aux->prog = fp;
119 121
120 /* We keep fp->aux from fp_old around in the new 122 /* We keep fp->aux from fp_old around in the new
121 * reallocated structure. 123 * reallocated structure.
@@ -726,7 +728,6 @@ void bpf_prog_free(struct bpf_prog *fp)
726 struct bpf_prog_aux *aux = fp->aux; 728 struct bpf_prog_aux *aux = fp->aux;
727 729
728 INIT_WORK(&aux->work, bpf_prog_free_deferred); 730 INIT_WORK(&aux->work, bpf_prog_free_deferred);
729 aux->prog = fp;
730 schedule_work(&aux->work); 731 schedule_work(&aux->work);
731} 732}
732EXPORT_SYMBOL_GPL(bpf_prog_free); 733EXPORT_SYMBOL_GPL(bpf_prog_free);