fbdev: tdfxfb: avoid divide-by-zero on FBIOPUT_VSCREENINFO
PATCH 1/1 fbdev: tdfxfb: avoid divide-by-zero on FBIOPUT_VSCREENINFO
Much like commit 19f953e74356 ("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]>
--- drivers/video/fbdev/tdfxfb.c | 3 +++ 1 file changed, 3 insertions(+)
drivers/video/fbdev/tdfxfb.c +3 -0
@@ -496,6 +496,9 @@ static int tdfxfb_check_var(struct fb_var_screeninfo *var, struct fb_info *info) } } +if (!var->pixclock) +return -EINVAL ; +if (PICOS2KHZ (var->pixclock) > par->max_pixclock) {DPRINTK ("pixclock too high (%ldKHz)\n" ,PICOS2KHZ (var->pixclock));
Signature · 1 line
2.53.0
Quoted 5 lines · Greg Kroah-Hartman
Much like commit
19f953e74356("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.
Quoted 7 lines
Cc Helge Deller <[email protected]>Assisted-by gregkh_clanker_t1000Cc stable <[email protected]>Signed-off-by Greg Kroah-Hartman <[email protected]>--- drivers/video/fbdev/tdfxfb.c | 3 +++ 1 file changed, 3 insertions(+)
applied.
Thanks!
Helge