Skip to contentSkip to conversation

fbcon: when font is freed, clear also vc_font.data

PATCH New Mika Kuoppala 1 participant 1 message Apr 22, 2013

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 fbcon: when font is freed, clear also vc_font.data

commit ae1287865f5361fa138d4d3b1b6277908b54eac9

Author: Dave Airlie <[email protected]>
Date:   Thu Jan 24 16:12:41 2013 +1000
    fbcon: don't lose the console font across generic->chip driver switch

uses a pointer in vc->vc_font.data to load font into the new driver. However if the font is actually freed, we need to clear the data so that we don't reload font from dangling pointer.

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

---
 drivers/video/console/fbcon.c |    2 ++
 1 file changed, 2 insertions(+)
drivers/video/console/fbcon.c +2 -0
index 3cd6759..a92783e 100644
@@ -1228,6 +1228,8 @@ static void fbcon_deinit(struct vc_data *vc)
 finished:
 
 	fbcon_free_font(p, free_font);
+	if (free_font)
+		vc->vc_font.data = NULL;
 
 	if (!con_is_bound(&fb_con))
 		fbcon_exit();
Signature · 1 line
1.7.9.5