]> git.baikalelectronics.ru Git - kernel.git/commit
drm/komeda: Fix potential integer overflow in komeda_crtc_update_clock_ratio
authorGustavo A. R. Silva <gustavo@embeddedor.com>
Mon, 12 Aug 2019 00:08:01 +0000 (19:08 -0500)
committerjames qian wang (Arm Technology China) <james.qian.wang@arm.com>
Mon, 12 Aug 2019 11:28:49 +0000 (19:28 +0800)
commit1f5d9997c820bd5f80db6ce8cea80dabab7a6817
tree45fd962906daf4289accc9cbb2f6bcd308a87b5c
parentfb384d6bde382dec579d7477c8e2351675f8fc22
drm/komeda: Fix potential integer overflow in komeda_crtc_update_clock_ratio

Add suffix ULL to constant 1000 in order to avoid a potential integer
overflow and give the compiler complete information about the proper
arithmetic to use. Notice that this constant is being used in a context
that expects an expression of type u64, but it's currently evaluated
using 32-bit arithmetic.

Addresses-Coverity-ID: 1485796 ("Unintentional integer overflow")
Fixes: 42dc4e3ad262 ("drm/komeda: Use drm_display_mode "crtc_" prefixed hardware timings")
Signed-off-by: Gustavo A. R. Silva <gustavo@embeddedor.com>
Reviewed-by: James Qian Wang (Arm Technology China) <james.qian.wang@arm.com>
Signed-off-by: james qian wang (Arm Technology China) <james.qian.wang@arm.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20190812000801.GA29204@embeddedor
drivers/gpu/drm/arm/display/komeda/komeda_crtc.c