diff options
author | Saud Farooqui <farooqui_saud@hotmail.com> | 2022-06-09 21:50:31 +0300 |
---|---|---|
committer | Maxime Ripard <maxime@cerno.tech> | 2022-06-22 10:30:17 +0300 |
commit | 5f940e528da6bce52a86fbdf881b76f60240aeaf (patch) | |
tree | 5344072ab482f55497e3077640f0be4d39b23409 /drivers | |
parent | be33d52ef5b4bdfec04cfdad39368c343bac97a3 (diff) | |
download | linux-5f940e528da6bce52a86fbdf881b76f60240aeaf.tar.xz |
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@hotmail.com>
Signed-off-by: Maxime Ripard <maxime@cerno.tech>
Link: https://patchwork.freedesktop.org/patch/msgid/PA4P189MB1421E63C0FF3EBF234A80AB38BA79@PA4P189MB1421.EURP189.PROD.OUTLOOK.COM
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/gpu/drm/vc4/vc4_hdmi.c | 2 |
1 files changed, 1 insertions, 1 deletions
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; |