linux/drivers/video/console
Masami Ichikawa 46862145d4 fbcon: Fix memory leak in fbcon_exit().
kmemleak reported a memory leak as below.

unreferenced object 0xffff880036ca84c0 (size 16):
  comm "swapper/0", pid 1, jiffies 4294877407 (age 4434.633s)
  hex dump (first 16 bytes):
    00 00 00 00 00 00 00 00 00 00 00 00 00 00 ff ff  ................
  backtrace:
    [<ffffffff814ed01e>] kmemleak_alloc+0x4e/0xb0
    [<ffffffff8118913c>] __kmalloc+0x1fc/0x290
    [<ffffffff81302c9e>] bit_cursor+0x24e/0x6c0
    [<ffffffff812ff2f4>] fbcon_cursor+0x154/0x1d0
    [<ffffffff813675d8>] hide_cursor+0x28/0xa0
    [<ffffffff81368acf>] update_region+0x6f/0x90
    [<ffffffff81300268>] fbcon_switch+0x518/0x550
    [<ffffffff813695b9>] redraw_screen+0x189/0x240
    [<ffffffff8136a0e0>] do_bind_con_driver+0x360/0x380
    [<ffffffff8136a6e4>] do_take_over_console+0x114/0x1c0
    [<ffffffff812fdc83>] do_fbcon_takeover+0x63/0xd0
    [<ffffffff813023e5>] fbcon_event_notify+0x605/0x720
    [<ffffffff81501dcc>] notifier_call_chain+0x4c/0x70
    [<ffffffff81087f8d>] __blocking_notifier_call_chain+0x4d/0x70
    [<ffffffff81087fc6>] blocking_notifier_call_chain+0x16/0x20
    [<ffffffff812f201b>] fb_notifier_call_chain+0x1b/0x20

In this case ops->cursor_state.mask is allocated in bit_cursor() but
not freed in fbcon_exit(). So, fbcon_exit() needs to free buffer in its
process.
In the case, fbcon_exit() was called from fbcon_deinit() when driver
called remove_conflicting_framebuffers().

Signed-off-by: Masami Ichikawa <masami256@gmail.com>
Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ti.com>
2014-01-17 10:57:44 +02:00
..
bitblit.c fbcon: Fix bit_putcs() call to kmalloc(s, GFP_KERNEL) 2012-08-23 12:29:32 +00:00
dummycon.c
fbcon_ccw.c
fbcon_cw.c drivers/video/console/fbcon_cw.c: fix compiler warning in cw_update_attr 2013-04-29 15:54:26 -07:00
fbcon_rotate.c
fbcon_rotate.h
fbcon_ud.c
fbcon.c fbcon: Fix memory leak in fbcon_exit(). 2014-01-17 10:57:44 +02:00
fbcon.h
Kconfig fbdev: fbcon: select VT_HW_CONSOLE_BINDING 2013-08-02 16:17:51 -07:00
Makefile lib: Move fonts from drivers/video/console/ to lib/fonts/ 2013-06-28 10:28:22 +02:00
mdacon.c TTY:vt: convert remain take_over_console's users to do_take_over_console 2013-05-20 22:29:27 -07:00
newport_con.c TTY:vt: convert remain take_over_console's users to do_take_over_console 2013-05-20 22:29:27 -07:00
softcursor.c drivers/video/console/softcursor.c: remove redundant NULL check before kfree() 2012-12-10 11:33:53 +02:00
sticon.c TTY:vt: convert remain take_over_console's users to do_take_over_console 2013-05-20 22:29:27 -07:00
sticore.c parisc: sticon - unbreak on 64bit kernel 2013-11-07 22:46:20 +01:00
tileblit.c
vgacon.c vgacon: fix missing include. 2013-06-27 10:08:04 +10:00