drm/modes: Switch to 64bit maths to avoid integer overflow
authorVille Syrjälä <ville.syrjala@linux.intel.com>
Thu, 22 Oct 2020 19:42:56 +0000 (22:42 +0300)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 4 Mar 2021 10:38:27 +0000 (11:38 +0100)
commitbdbee7d7fd95ab064ad3d4988f4361c3f0cbafd7
treefce654ae48c291ec51a112e6706d11e5f2ee30ea
parent565eca5a9aa9d9e8fed9b8962a793678bbd748be
drm/modes: Switch to 64bit maths to avoid integer overflow

commit 5b34ab52401f0f1f191bcb83a182c83b506f4763 upstream.

The new >8k CEA modes have dotclocks reaching 5.94 GHz, which
means our clock*1000 will now overflow the 32bit unsigned
integer. Switch to 64bit maths to avoid it.

Cc: stable@vger.kernel.org
Reported-by: Randy Dunlap <rdunlap@infradead.org>
Signed-off-by: Ville Syrjälä <ville.syrjala@linux.intel.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20201022194256.30978-1-ville.syrjala@linux.intel.com
Tested-by: Randy Dunlap <rdunlap@infradead.org>
Reviewed-by: Chris Wilson <chris@chris-wilson.co.uk>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/gpu/drm/drm_modes.c