* [PATCH] drm/vc4: hdmi: Fixed possible integer overflow
@ 2022-06-09 18:50 Saud Farooqui
2022-06-22 7:37 ` (subset) " Maxime Ripard
0 siblings, 1 reply; 2+ messages in thread
From: Saud Farooqui @ 2022-06-09 18:50 UTC (permalink / raw)
To: emma, mripard, airlied, daniel, dri-devel, linux-kernel; +Cc: Saud Farooqui
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@hotmail.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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: (subset) [PATCH] drm/vc4: hdmi: Fixed possible integer overflow
2022-06-09 18:50 [PATCH] drm/vc4: hdmi: Fixed possible integer overflow Saud Farooqui
@ 2022-06-22 7:37 ` Maxime Ripard
0 siblings, 0 replies; 2+ messages in thread
From: Maxime Ripard @ 2022-06-22 7:37 UTC (permalink / raw)
To: dri-devel, airlied, mripard, linux-kernel, daniel, farooqui_saud, emma
Cc: Maxime Ripard
On Thu, 9 Jun 2022 23:50:31 +0500, Saud Farooqui wrote:
> 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.
>
>
> [...]
Applied to drm/drm-misc (drm-misc-fixes).
Thanks!
Maxime
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2022-06-22 7:37 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-06-09 18:50 [PATCH] drm/vc4: hdmi: Fixed possible integer overflow Saud Farooqui
2022-06-22 7:37 ` (subset) " Maxime Ripard
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.