fbcon: don't lose the console font across generic->chip driver switch
authorDave Airlie <airlied@redhat.com>
Thu, 24 Jan 2013 06:12:41 +0000 (16:12 +1000)
committerBen Hutchings <ben@decadent.org.uk>
Wed, 6 Mar 2013 03:23:51 +0000 (03:23 +0000)
commitb6f84cb8ce3aa61f0b9ee8e72f8a0b5a3003cd9c
treecd025167c499427a1a27f02d9f12878a8d5bcb64
parent154184713475e6a077724f0db41b0a921008512d
fbcon: don't lose the console font across generic->chip driver switch

commit ae1287865f5361fa138d4d3b1b6277908b54eac9 upstream.

If grub2 loads efifb/vesafb, then when systemd starts it can set the console
font on that framebuffer device, however when we then load the native KMS
driver, the first thing it does is tear down the generic framebuffer driver.

The thing is the generic code is doing the right thing, it frees the font
because otherwise it would leak memory. However we can assume that if you
are removing the generic firmware driver (vesa/efi/offb), that a new driver
*should* be loading soon after, so we effectively leak the font.

However the old code left a dangling pointer in vc->vc_font.data and we
can now reuse that dangling pointer to load the font into the new
driver, now that we aren't freeing it.

Bugzilla: https://bugzilla.redhat.com/show_bug.cgi?id=892340

Cc: Kay Sievers <kay.sievers@vrfy.org>
Signed-off-by: Dave Airlie <airlied@redhat.com>
Signed-off-by: Ben Hutchings <ben@decadent.org.uk>
drivers/video/console/fbcon.c