]> git.itanic.dy.fi Git - linux-stable/commit
drm/tegra: Avoid potential 32-bit integer overflow
authorNur Hussein <hussein@unixcat.org>
Wed, 5 Apr 2023 20:25:59 +0000 (04:25 +0800)
committerThierry Reding <treding@nvidia.com>
Thu, 6 Apr 2023 12:02:33 +0000 (14:02 +0200)
commit2429b3c529da29d4277d519bd66d034842dcd70c
treed4d9285d158e44b0b0238ac30f1e3ceed206e5dd
parent71ec16f45ef8d10e20c58e85f7d3644e324d3c13
drm/tegra: Avoid potential 32-bit integer overflow

In tegra_sor_compute_config(), the 32-bit value mode->clock is
multiplied by 1000, and assigned to the u64 variable pclk. We can avoid
a potential 32-bit integer overflow by casting mode->clock to u64 before
we do the arithmetic and assignment.

Signed-off-by: Nur Hussein <hussein@unixcat.org>
Signed-off-by: Thierry Reding <treding@nvidia.com>
drivers/gpu/drm/tegra/sor.c