]> git.kernelconcepts.de Git - karo-tx-linux.git/blobdiff - kernel/bpf/core.c
Merge remote-tracking branch 'rdma/for-next'
[karo-tx-linux.git] / kernel / bpf / core.c
index 80864712d2c405d077644604831685d1a94529eb..334b1bdd572c1e66007bd7163c9b98ee9c37deb5 100644 (file)
@@ -92,6 +92,7 @@ struct bpf_prog *bpf_prog_alloc(unsigned int size, gfp_t gfp_extra_flags)
 
        fp->pages = size / PAGE_SIZE;
        fp->aux = aux;
+       fp->aux->prog = fp;
 
        return fp;
 }
@@ -116,6 +117,7 @@ struct bpf_prog *bpf_prog_realloc(struct bpf_prog *fp_old, unsigned int size,
 
                memcpy(fp, fp_old, fp_old->pages * PAGE_SIZE);
                fp->pages = size / PAGE_SIZE;
+               fp->aux->prog = fp;
 
                /* We keep fp->aux from fp_old around in the new
                 * reallocated structure.
@@ -726,7 +728,6 @@ void bpf_prog_free(struct bpf_prog *fp)
        struct bpf_prog_aux *aux = fp->aux;
 
        INIT_WORK(&aux->work, bpf_prog_free_deferred);
-       aux->prog = fp;
        schedule_work(&aux->work);
 }
 EXPORT_SYMBOL_GPL(bpf_prog_free);