drm/radeon/r100: Fix integer overflow issues in r100_cs_track_check()
authorNikita Zhandarovich <n.zhandarovich@fintech.ru>
Wed, 29 Nov 2023 15:22:12 +0000 (07:22 -0800)
committerAlex Deucher <alexander.deucher@amd.com>
Thu, 30 Nov 2023 23:26:31 +0000 (18:26 -0500)
commitb5c5baa458faa5430c445acd9a17481274d77ccf
tree33102ed467fe35f1be819119be7510c16aa4d5fd
parent39c960bbf9d9ea862398759e75736cfb68c3446f
drm/radeon/r100: Fix integer overflow issues in r100_cs_track_check()

It may be possible, albeit unlikely, to encounter integer overflow
during the multiplication of several unsigned int variables, the
result being assigned to a variable 'size' of wider type.

Prevent this potential behaviour by converting one of the multiples
to unsigned long.

Found by Linux Verification Center (linuxtesting.org) with static
analysis tool SVACE.

Fixes: 0242f74d29df ("drm/radeon: clean up CS functions in r100.c")
Signed-off-by: Nikita Zhandarovich <n.zhandarovich@fintech.ru>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/radeon/r100.c