]> git.proxmox.com Git - mirror_ubuntu-kernels.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)
committerStefan Bader <stefan.bader@canonical.com>
Wed, 9 Aug 2023 09:37:54 +0000 (11:37 +0200)
commit5df615e4887e9c30170bd02870a3a5111de3dc6e
tree30eb797894c2f0c2ff017661a9bb9b1d14af2582
parent3b6e32e9baee32c50dea6c78ca1bc7655696b63a
drm/tegra: Avoid potential 32-bit integer overflow

BugLink: https://bugs.launchpad.net/bugs/2028808
[ 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>
Signed-off-by: Kamal Mostafa <kamal@canonical.com>
Signed-off-by: Stefan Bader <stefan.bader@canonical.com>
drivers/gpu/drm/tegra/sor.c