lib: simplefb: make get_font_scale_factor run only if simplefb probed

get_font_scale_factor() unconditionally dereferences fb_info and debug.c's
fb_output() calls get_font_scale_factor() on each printk call, even before
we have simplefb registered. As __simplefb_raw_print has a check if we're
past simplefb probe (fb_info is filled), do the same for get_font_scale_factor()
and return 1 (not scaled) if the struct is not filled.
This commit is contained in:
Ivaylo Ivanov committed 2026-05-28 00:01:44 +03:00
1 parent 3c90e2b35f
commit e71ad3b705
1 file changed
+3
+3
View File
@@ -62,6 +62,9 @@ static void draw_pixel(volatile char *fb, int x, int y, int width, int stride,
int get_font_scale_factor()
{
if (!fb_info)
return 1;
if (fb_info->scale) {
return fb_info->scale;
}