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>
此提交包含在:
Kees Cook
2016-04-06 15:53:27 -07:00
父節點 d2e10088ce
當前提交 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;