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

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
Loading
Loading
Loading
Loading
+3 −1
Original line number Diff line number Diff line
@@ -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;