* [PATCH] video: console: Fix default font selection
@ 2023-05-25 12:17 Ondřej Jirman
2023-07-17 15:23 ` Anatolij Gustschin
0 siblings, 1 reply; 2+ messages in thread
From: Ondřej Jirman @ 2023-05-25 12:17 UTC (permalink / raw)
To: u-boot; +Cc: Ondrej Jirman, Anatolij Gustschin
From: Ondrej Jirman <megi@xff.cz>
Some callers expect to call this with NULL font name to select the
default font (eg. boot/scene.c). Without handling the NULL condition
U-Boot crashes instead of displaying a bootflow GUI menu.
Signed-off-by: Ondrej Jirman <megi@xff.cz>
Cc: Anatolij Gustschin <agust@denx.de>
---
drivers/video/console_core.c | 6 ++++++
1 file changed, 6 insertions(+)
diff --git a/drivers/video/console_core.c b/drivers/video/console_core.c
index 1f93b1b85fa5..b5d0e3dceca3 100644
--- a/drivers/video/console_core.c
+++ b/drivers/video/console_core.c
@@ -201,6 +201,12 @@ int console_simple_select_font(struct udevice *dev, const char *name, uint size)
{
struct video_fontdata *font;
+ if (!name) {
+ if (fonts->name)
+ console_set_font(dev, fonts);
+ return 0;
+ }
+
for (font = fonts; font->name; font++) {
if (!strcmp(name, font->name)) {
console_set_font(dev, font);
--
2.40.1
^ permalink raw reply related [flat|nested] 2+ messages in thread* Re: [PATCH] video: console: Fix default font selection
2023-05-25 12:17 [PATCH] video: console: Fix default font selection Ondřej Jirman
@ 2023-07-17 15:23 ` Anatolij Gustschin
0 siblings, 0 replies; 2+ messages in thread
From: Anatolij Gustschin @ 2023-07-17 15:23 UTC (permalink / raw)
To: Ondřej Jirman; +Cc: u-boot
On Thu, 25 May 2023 14:17:15 +0200
Ondřej Jirman megi@xff.cz wrote:
> From: Ondrej Jirman <megi@xff.cz>
>
> Some callers expect to call this with NULL font name to select the
> default font (eg. boot/scene.c). Without handling the NULL condition
> U-Boot crashes instead of displaying a bootflow GUI menu.
>
> Signed-off-by: Ondrej Jirman <megi@xff.cz>
> Cc: Anatolij Gustschin <agust@denx.de>
> ---
> drivers/video/console_core.c | 6 ++++++
> 1 file changed, 6 insertions(+)
applied to u-boot-video/master, thanks!
--
Anatolij
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2023-07-17 15:23 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2023-05-25 12:17 [PATCH] video: console: Fix default font selection Ondřej Jirman
2023-07-17 15:23 ` Anatolij Gustschin
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox