video: console: Fix buffer overflow in cmd 'font list'

vidconsole_ops.get_font is documented to return -ENOENT after the last
video_fontdata entry.

Signed-off-by: Janne Grunau <j@jannau.net>
This commit is contained in:
Janne Grunau 2024-01-17 23:29:29 +01:00 committed by Tom Rini
parent 3883c9add0
commit 24adbee344

View file

@ -225,7 +225,7 @@ int console_simple_get_font(struct udevice *dev, int seq, struct vidfont_info *i
{
info->name = fonts[seq].name;
return 0;
return info->name ? 0 : -ENOENT;
}
int console_simple_select_font(struct udevice *dev, const char *name, uint size)