[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-ID: <PA4P189MB1421E63C0FF3EBF234A80AB38BA79@PA4P189MB1421.EURP189.PROD.OUTLOOK.COM>
Date: Thu, 9 Jun 2022 23:50:31 +0500
From: Saud Farooqui <farooqui_saud@...mail.com>
To: emma@...olt.net, mripard@...nel.org, airlied@...ux.ie,
daniel@...ll.ch, dri-devel@...ts.freedesktop.org,
linux-kernel@...r.kernel.org
Cc: Saud Farooqui <farooqui_saud@...mail.com>
Subject: [PATCH] drm/vc4: hdmi: Fixed possible integer overflow
Multiplying ints and saving it in unsigned long long
could lead to integer overflow before being type casted to
unsigned long long.
Addresses-Coverity: 1505113: Unintentional integer overflow.
Signed-off-by: Saud Farooqui <farooqui_saud@...mail.com>
---
drivers/gpu/drm/vc4/vc4_hdmi.c | 2 +-
1 file changed, 1 insertion(+), 1 deletion(-)
diff --git a/drivers/gpu/drm/vc4/vc4_hdmi.c b/drivers/gpu/drm/vc4/vc4_hdmi.c
index 823d812f4982..ce9d16666d91 100644
--- a/drivers/gpu/drm/vc4/vc4_hdmi.c
+++ b/drivers/gpu/drm/vc4/vc4_hdmi.c
@@ -1481,7 +1481,7 @@ vc4_hdmi_encoder_compute_mode_clock(const struct drm_display_mode *mode,
unsigned int bpc,
enum vc4_hdmi_output_format fmt)
{
- unsigned long long clock = mode->clock * 1000;
+ unsigned long long clock = mode->clock * 1000ULL;
if (mode->flags & DRM_MODE_FLAG_DBLCLK)
clock = clock * 2;
--
2.25.1
Powered by blists - more mailing lists