Commit 686cb8b9 authored by Tiezhu Yang's avatar Tiezhu Yang Committed by Vasily Gorbik

bpf, s390: Fix potential memory leak about jit_data

Make sure to free jit_data through kfree() in the error path.

Fixes: 1c8f9b91 ("bpf: s390: add JIT support for multi-function programs")
Signed-off-by: default avatarTiezhu Yang <yangtiezhu@loongson.cn>
Acked-by: default avatarIlya Leoshkevich <iii@linux.ibm.com>
Reviewed-by: default avatarChristian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: default avatarChristian Borntraeger <borntraeger@de.ibm.com>
Signed-off-by: default avatarVasily Gorbik <gor@linux.ibm.com>
parent 9e1ff307
......@@ -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:
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment