From e71ad3b705d83414f7155aef07b3dab6acf53362 Mon Sep 17 00:00:00 2001 From: Ivaylo Ivanov Date: Wed, 27 May 2026 16:56:38 +0000 Subject: [PATCH] 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. --- lib/simplefb/simplefb.c | 3 +++ 1 file changed, 3 insertions(+) diff --git a/lib/simplefb/simplefb.c b/lib/simplefb/simplefb.c index 8d8a625..99822b7 100644 --- a/lib/simplefb/simplefb.c +++ b/lib/simplefb/simplefb.c @@ -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; }