Commit 8f98b81f authored by Greg Kroah-Hartman's avatar Greg Kroah-Hartman Committed by Helge Deller
Browse files

fbdev: tdfxfb: avoid divide-by-zero on FBIOPUT_VSCREENINFO



Much like commit 19f953e7 ("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 <deller@gmx.de>
Assisted-by: gregkh_clanker_t1000
Cc: stable <stable@kernel.org>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Signed-off-by: default avatarHelge Deller <deller@gmx.de>
parent 98cf7df6
Loading
Loading
Loading
Loading
+3 −0
Original line number Diff line number Diff line
@@ -497,6 +497,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));