summaryrefslogtreecommitdiffstats
path: root/arch/s390/net
diff options
context:
space:
mode:
authorTiezhu Yang <yangtiezhu@loongson.cn>2021-09-27 09:06:14 +0200
committerVasily Gorbik <gor@linux.ibm.com>2021-10-04 09:49:10 +0200
commit686cb8b9f6b46787f035afe8fbd132a74e6b1bdd (patch)
tree6ae2b0f4ccfef014f287c7ea5379f4da68c3b17b /arch/s390/net
parentLinux 5.15-rc4 (diff)
downloadlinux-686cb8b9f6b46787f035afe8fbd132a74e6b1bdd.tar.xz
linux-686cb8b9f6b46787f035afe8fbd132a74e6b1bdd.zip
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/net')
-rw-r--r--arch/s390/net/bpf_jit_comp.c2
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: