mirror of
https://github.com/torvalds/linux.git
synced 2026-06-07 05:55:44 +02:00
bpf, s390: Fix potential memory leak about jit_data
[ Upstream commit686cb8b9f6] Make sure to free jit_data through kfree() in the error path. Fixes:1c8f9b91c4("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> Signed-off-by: Sasha Levin <sashal@kernel.org>
This commit is contained in:
parent
2c152d9da8
commit
29fdb11ca8
|
|
@ -1775,7 +1775,7 @@ struct bpf_prog *bpf_int_jit_compile(struct bpf_prog *fp)
|
||||||
jit.addrs = kvcalloc(fp->len + 1, sizeof(*jit.addrs), GFP_KERNEL);
|
jit.addrs = kvcalloc(fp->len + 1, sizeof(*jit.addrs), GFP_KERNEL);
|
||||||
if (jit.addrs == NULL) {
|
if (jit.addrs == NULL) {
|
||||||
fp = orig_fp;
|
fp = orig_fp;
|
||||||
goto out;
|
goto free_addrs;
|
||||||
}
|
}
|
||||||
/*
|
/*
|
||||||
* Three initial passes:
|
* Three initial passes:
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user