summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKarol Przybylski <karprzy7@gmail.com>2024-12-15 13:53:55 +0100
committerTomi Valkeinen <tomi.valkeinen@ideasonboard.com>2024-12-16 12:03:30 +0200
commit67a615c5cb6dc33ed35492dc0d67e496cbe8de68 (patch)
tree09c6b4b0cd141e317d659d99a7e5a423e1efb8d5
parent0ca953ac226eaffbe1a795f5e517095a8d494921 (diff)
drm: zynqmp_dp: Fix integer overflow in zynqmp_dp_rate_get()HEADdrm-misc-next-2024-12-16for-linux-nextdrm-misc-next
This patch fixes a potential integer overflow in the zynqmp_dp_rate_get() The issue comes up when the expression drm_dp_bw_code_to_link_rate(dp->test.bw_code) * 10000 is evaluated using 32-bit Now the constant is a compatible 64-bit type. Resolves coverity issues: CID 1636340 and CID 1635811 Cc: stable@vger.kernel.org Fixes: 28edaacb821c ("drm: zynqmp_dp: Add debugfs interface for compliance testing") Signed-off-by: Karol Przybylski <karprzy7@gmail.com> Reviewed-by: Laurent Pinchart <laurent.pinchart@ideasonboard.com> Link: https://lore.kernel.org/stable/20241212095057.1015146-1-karprzy7%40gmail.com Signed-off-by: Tomi Valkeinen <tomi.valkeinen@ideasonboard.com> Link: https://patchwork.freedesktop.org/patch/msgid/20241215125355.938953-1-karprzy7@gmail.com
-rw-r--r--drivers/gpu/drm/xlnx/zynqmp_dp.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/gpu/drm/xlnx/zynqmp_dp.c b/drivers/gpu/drm/xlnx/zynqmp_dp.c
index 25c5dc61ee88..56a261a40ea3 100644
--- a/drivers/gpu/drm/xlnx/zynqmp_dp.c
+++ b/drivers/gpu/drm/xlnx/zynqmp_dp.c
@@ -2190,7 +2190,7 @@ static int zynqmp_dp_rate_get(void *data, u64 *val)
struct zynqmp_dp *dp = data;
mutex_lock(&dp->lock);
- *val = drm_dp_bw_code_to_link_rate(dp->test.bw_code) * 10000;
+ *val = drm_dp_bw_code_to_link_rate(dp->test.bw_code) * 10000ULL;
mutex_unlock(&dp->lock);
return 0;
}