mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/next/linux-next.git
synced 2025-01-09 07:23:14 +00:00
lkdtm: do not leak free page on kmalloc failure
This frees the allocated page if there is a kmalloc failure. Signed-off-by: Kees Cook <keescook@chromium.org>
This commit is contained in:
parent
d2e10088ce
commit
3d085c7413
@ -507,8 +507,10 @@ static void lkdtm_do_action(enum ctype which)
|
||||
break;
|
||||
|
||||
val = kmalloc(1024, GFP_KERNEL);
|
||||
if (!val)
|
||||
if (!val) {
|
||||
free_page(p);
|
||||
break;
|
||||
}
|
||||
|
||||
base = (int *)p;
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user