]> git.ipfire.org Git - thirdparty/kernel/stable.git/commit
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Sat, 10 Nov 2018 15:49:47 +0000 (07:49 -0800)
commit962bc4202bf0d7ff84deec4cdc6343a103c3c010
treee45d568a29439f4a7eb063c1d3a8cee0f226a2a0
parent05d586677df06a8abd499c45321fc6e0e34611e6
drm/sun4i: Fix an ulong overflow in the dotclock driver

commit e84cb605e02f1b3d0aee8d7157419cd8aaa06038 upstream.

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
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/sun4i/sun4i_dotclock.c