Skip to content

Commit 61ac4b8

Browse files
harperchenhdeller
authored andcommitted
fbdev: lxfb: Fix potential divide by zero
var->pixclock can be assigned to zero by user. Without proper check, divide by zero would occur in lx_set_clock. Error out if var->pixclock is zero. Signed-off-by: Wei Chen <[email protected]> Signed-off-by: Helge Deller <[email protected]>
1 parent d823685 commit 61ac4b8

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

drivers/video/fbdev/geode/lxfb_core.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -235,6 +235,9 @@ static void get_modedb(struct fb_videomode **modedb, unsigned int *size)
235235

236236
static int lxfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
237237
{
238+
if (!var->pixclock)
239+
return -EINVAL;
240+
238241
if (var->xres > 1920 || var->yres > 1440)
239242
return -EINVAL;
240243

0 commit comments

Comments
 (0)