Re: [PATCH 5/6] drm/panic: Fix divide by 0 if the screen width < font width

From: Javier Martinez Canillas

Date: Tue Oct 14 2025 - 03:36:32 EST


Jocelyn Falempe <jfalempe@xxxxxxxxxx> writes:

> In the unlikely case that the screen is tiny, and smaller than the
> font width, it leads to a divide by 0:
>
> draw_line_with_wrap()
> chars_per_row = sb->width / font->width = 0
> line_wrap.len = line->len % chars_per_row;
>
> This will trigger a divide by 0
>
> Signed-off-by: Jocelyn Falempe <jfalempe@xxxxxxxxxx>
> ---

Reviewed-by: Javier Martinez Canillas <javierm@xxxxxxxxxx>

--
Best regards,

Javier Martinez Canillas
Core Platforms
Red Hat