diff options
author | Tiezhu Yang | 2021-09-27 15:06:14 +0800 |
---|---|---|
committer | Vasily Gorbik | 2021-10-04 09:49:10 +0200 |
commit | 686cb8b9f6b46787f035afe8fbd132a74e6b1bdd (patch) | |
tree | 6ae2b0f4ccfef014f287c7ea5379f4da68c3b17b /arch/s390 | |
parent | 9e1ff307c779ce1f0f810c7ecce3d95bbae40896 (diff) |
bpf, s390: Fix potential memory leak about jit_data
Make sure to free jit_data through kfree() in the error path.
Fixes: 1c8f9b91c456 ("bpf: s390: add JIT support for multi-function programs")
Signed-off-by: Tiezhu Yang <yangtiezhu@loongson.cn>
Acked-by: Ilya Leoshkevich <iii@linux.ibm.com>
Reviewed-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Christian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: Vasily Gorbik <gor@linux.ibm.com>
Diffstat (limited to 'arch/s390')
-rw-r--r-- | arch/s390/net/bpf_jit_comp.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/arch/s390/net/bpf_jit_comp.c b/arch/s390/net/bpf_jit_comp.c index 840d8594437d..1a374d021e25 100644 --- a/arch/s390/net/bpf_jit_comp.c +++ b/arch/s390/net/bpf_jit_comp.c @@ -1826,7 +1826,7 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *fp) jit.addrs = kvcalloc(fp->len + 1, sizeof(*jit.addrs), GFP_KERNEL); if (jit.addrs == NULL) { fp = orig_fp; - goto out; + goto free_addrs; } /* * Three initial passes: |