Commit 3d085c74 authored by Kees Cook's avatar Kees Cook

lkdtm: do not leak free page on kmalloc failure

This frees the allocated page if there is a kmalloc failure.
Signed-off-by: default avatarKees Cook <keescook@chromium.org>
parent d2e10088
......@@ -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;
......
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