]> Gentwo Git Trees - linux/.git/commit
drm/panic: Fix divide by 0 if the screen width < font width
authorJocelyn Falempe <jfalempe@redhat.com>
Thu, 9 Oct 2025 12:24:52 +0000 (14:24 +0200)
committerJocelyn Falempe <jfalempe@redhat.com>
Tue, 21 Oct 2025 09:28:03 +0000 (11:28 +0200)
commit2e337dd278c6c38982b520c309f36e0f88696e6e
tree42e5a7fb6cab3d8bea2cd035528da6f8c5158564
parente9b36fe0630046e61224216dc92513a69f72b5f0
drm/panic: Fix divide by 0 if the screen width < font width

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

Reviewed-by: Javier Martinez Canillas <javierm@redhat.com>
Link: https://lore.kernel.org/r/20251009122955.562888-6-jfalempe@redhat.com
Signed-off-by: Jocelyn Falempe <jfalempe@redhat.com>
drivers/gpu/drm/drm_panic.c