Commit 67a615c5 authored by Karol Przybylski's avatar Karol Przybylski Committed by Tomi Valkeinen
Browse files

drm: zynqmp_dp: Fix integer overflow in zynqmp_dp_rate_get()



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: 28edaacb ("drm: zynqmp_dp: Add debugfs interface for compliance testing")
Signed-off-by: default avatarKarol Przybylski <karprzy7@gmail.com>
Reviewed-by: default avatarLaurent Pinchart <laurent.pinchart@ideasonboard.com>
Link: https://lore.kernel.org/stable/20241212095057.1015146-1-karprzy7%40gmail.com


Signed-off-by: default avatarTomi Valkeinen <tomi.valkeinen@ideasonboard.com>
Link: https://patchwork.freedesktop.org/patch/msgid/20241215125355.938953-1-karprzy7@gmail.com
parent 0ca953ac
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -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;
}