mirror of
git://nv-tegra.nvidia.com/linux-nvgpu.git
synced 2025-12-24 02:22:34 +03:00
gpu: nvgpu: fix error condition in nvgpu_safe_mult_u64
This patch fixes error condition in nvgpu_safe_mult_u64. As this function is operating on u64, ULONG_MAX should be used to check error condition. NVGPU-3432 Change-Id: I950c70bb0f26b58ae7ba0f04fad5c2bde64f07ba Signed-off-by: Vaibhav Kachore <vkachore@nvidia.com> Reviewed-on: https://git-master.nvidia.com/r/2128612 Reviewed-by: mobile promotions <svcmobile_promotions@nvidia.com> Tested-by: mobile promotions <svcmobile_promotions@nvidia.com>
This commit is contained in:
committed by
mobile promotions
parent
caf5ebacba
commit
ceeead091e
@@ -97,7 +97,7 @@ static inline u64 nvgpu_safe_mult_u64(u64 ul_a, u64 ul_b)
|
||||
{
|
||||
if (ul_a == 0 || ul_b == 0) {
|
||||
return 0UL;
|
||||
} else if (ul_a > UINT_MAX / ul_b) {
|
||||
} else if (ul_a > ULONG_MAX / ul_b) {
|
||||
BUG();
|
||||
} else {
|
||||
return ul_a * ul_b;
|
||||
|
||||
Reference in New Issue
Block a user