fbmon: prevent division by zero in fb_videomode_from_videomode()
authorRoman Smirnov <r.smirnov@omp.ru>
Tue, 19 Mar 2024 08:13:44 +0000 (11:13 +0300)
committerHelge Deller <deller@gmx.de>
Tue, 19 Mar 2024 12:20:20 +0000 (13:20 +0100)
commitc2d953276b8b27459baed1277a4fdd5dd9bd4126
treee34231f5c097e9615e72765af90c608aa69ef363
parent152609795dbf02f004c86049b75c23f4e68071d8
fbmon: prevent division by zero in fb_videomode_from_videomode()

The expression htotal * vtotal can have a zero value on
overflow. It is necessary to prevent division by zero like in
fb_var_to_videomode().

Found by Linux Verification Center (linuxtesting.org) with Svace.

Signed-off-by: Roman Smirnov <r.smirnov@omp.ru>
Reviewed-by: Sergey Shtylyov <s.shtylyov@omp.ru>
Signed-off-by: Helge Deller <deller@gmx.de>
drivers/video/fbdev/core/fbmon.c