Skip to content

Commit 8f98b81

Browse files
gregkhhdeller
authored andcommitted
fbdev: tdfxfb: avoid divide-by-zero on FBIOPUT_VSCREENINFO
Much like commit 19f953e ("fbdev: fb_pm2fb: Avoid potential divide by zero error"), we also need to prevent that same crash from happening in the udlfb driver as it uses pixclock directly when dividing, which will crash. Cc: Helge Deller <[email protected]> Assisted-by: gregkh_clanker_t1000 Cc: stable <[email protected]> Signed-off-by: Greg Kroah-Hartman <[email protected]> Signed-off-by: Helge Deller <[email protected]>
1 parent 98cf7df commit 8f98b81

1 file changed

Lines changed: 3 additions & 0 deletions

File tree

drivers/video/fbdev/tdfxfb.c

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -497,6 +497,9 @@ static int tdfxfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info)
497497
}
498498
}
499499

500+
if (!var->pixclock)
501+
return -EINVAL;
502+
500503
if (PICOS2KHZ(var->pixclock) > par->max_pixclock) {
501504
DPRINTK("pixclock too high (%ldKHz)\n",
502505
PICOS2KHZ(var->pixclock));

0 commit comments

Comments
 (0)