fbdev: intelfb: Fix potential divide by zero
authorWei Chen <harperchen1110@gmail.com>
Wed, 15 Mar 2023 08:33:47 +0000 (08:33 +0000)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 6 Apr 2023 10:10:41 +0000 (12:10 +0200)
commit8ab9eada22d93fa501072161ceedbd6d61bc8df7
treea3d116c0b2ba38b9d22388533436322310c88515
parentc8d88107971e13e65575885e42ce1908b0d6799e
fbdev: intelfb: Fix potential divide by zero

[ Upstream commit d823685486a3446d061fed7c7d2f80af984f119a ]

Variable var->pixclock is controlled by user and can be assigned
to zero. Without proper check, divide by zero would occur in
intelfbhw_validate_mode and intelfbhw_mode_to_hw.

Error out if var->pixclock is zero.

Signed-off-by: Wei Chen <harperchen1110@gmail.com>
Signed-off-by: Helge Deller <deller@gmx.de>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/video/fbdev/intelfb/intelfbdrv.c