From 5c9228f0cfb09a098a8a380116b42ae099e967b6 Mon Sep 17 00:00:00 2001 From: Johannes Weiner Date: Thu, 16 Jul 2009 16:06:09 +0100 Subject: vt: drop bootmem/slab memory distinction Bootmem is not used for the vt screen buffer anymore as slab is now available at the time the console is initialized. Get rid of the now superfluous distinction between slab and bootmem, it's always slab. This also fixes a kmalloc leak which Catalin described thusly: Commit a5f4f52e ("vt: use kzalloc() instead of the bootmem allocator") replaced the alloc_bootmem() with kzalloc() but didn't set vc_kmalloced to 1 and the memory block is later leaked. The corresponding kmemleak trace: unreferenced object 0xdf828000 (size 8192): comm "swapper", pid 0, jiffies 4294937296 backtrace: [] __save_stack_trace+0x17/0x1c [] log_early+0x55/0x84 [] kmemleak_alloc+0x33/0x3c [] __kmalloc+0xd7/0xe4 [] con_init+0xbf/0x1b8 [] console_init+0x11/0x20 [] start_kernel+0x137/0x1e4 Signed-off-by: Johannes Weiner Reviewed-by: Pekka Enberg Tested-by: Catalin Marinas Signed-off-by: Andrew Morton Signed-off-by: Alan Cox Signed-off-by: Linus Torvalds --- include/linux/console_struct.h | 1 - 1 file changed, 1 deletion(-) (limited to 'include/linux/console_struct.h') diff --git a/include/linux/console_struct.h b/include/linux/console_struct.h index d71f7c0f931b..38fe59dc89ae 100644 --- a/include/linux/console_struct.h +++ b/include/linux/console_struct.h @@ -89,7 +89,6 @@ struct vc_data { unsigned int vc_need_wrap : 1; unsigned int vc_can_do_color : 1; unsigned int vc_report_mouse : 2; - unsigned int vc_kmalloced : 1; unsigned char vc_utf : 1; /* Unicode UTF-8 encoding */ unsigned char vc_utf_count; int vc_utf_char; -- cgit v1.2.3-59-g8ed1b