OSDN Git Service

drm/sun4i: Fix an ulong overflow in the dotclock driver
authorBoris Brezillon <boris.brezillon@bootlin.com>
Thu, 18 Oct 2018 10:02:50 +0000 (12:02 +0200)
committerMaxime Ripard <maxime.ripard@bootlin.com>
Fri, 19 Oct 2018 09:50:25 +0000 (11:50 +0200)
commite84cb605e02f1b3d0aee8d7157419cd8aaa06038
treea479bb12e9d290e8f14da3402ad48fcabf9cf6d0
parent4364bcb2cd21d042bde4776448417ddffbc54045
drm/sun4i: Fix an ulong overflow in the dotclock driver

The calculated ideal rate can easily overflow an unsigned long, thus
making the best div selection buggy as soon as no ideal match is found
before the overflow occurs.

Fixes: 4731a72df273 ("drm/sun4i: request exact rates to our parents")
Cc: <stable@vger.kernel.org>
Signed-off-by: Boris Brezillon <boris.brezillon@bootlin.com>
Acked-by: Maxime Ripard <maxime.ripard@bootlin.com>
Signed-off-by: Maxime Ripard <maxime.ripard@bootlin.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20181018100250.12565-1-boris.brezillon@bootlin.com
drivers/gpu/drm/sun4i/sun4i_dotclock.c