]> git.baikalelectronics.ru Git - kernel.git/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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Tue, 30 May 2023 11:44:02 +0000 (12:44 +0100)
commit31ec4bfb7bc409124efefc1bafca099fa1a3b704
tree2bb219d27124c9b2de98a84529d7a83e833c10a1
parent114b59714631fd2b620758bc99d9708c62516108
drm/tegra: Avoid potential 32-bit integer overflow

[ Upstream commit 2429b3c529da29d4277d519bd66d034842dcd70c ]

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>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/gpu/drm/tegra/sor.c