提交 3d085c74 编写于 作者: K 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: NKees Cook <keescook@chromium.org>
上级 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% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册