]> git.baikalelectronics.ru Git - kernel.git/commit
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>
Wed, 5 Apr 2023 09:16:42 +0000 (11:16 +0200)
commite0447380961c9400d3a6ebb501b1f6c6247fb79a
tree2d3bd647970c9a5f3ccd25404d21de7712e77bcf
parentd097d706140567f9298a52a4959740d10c92c1ce
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