]> git.baikalelectronics.ru Git - kernel.git/commit
drm/amdkfd: fix uint32 variable compared to less than zero
authorColin Ian King <colin.king@canonical.com>
Thu, 22 Apr 2021 12:31:58 +0000 (13:31 +0100)
committerAlex Deucher <alexander.deucher@amd.com>
Fri, 23 Apr 2021 21:16:43 +0000 (17:16 -0400)
commit6962bcb363ed7fedb0cea269de14a224e1c871a6
tree9f8928b12559937f0a6922b297ad078b54a81cf5
parent4fd490b564c49a0fec762173ff72a2f47d3f52a8
drm/amdkfd: fix uint32 variable compared to less than zero

Currently the call to kfd_process_gpuidx_from_gpuid is returning an
int value and this is being assigned to a uint32_t variable gpuidx
and this is being checked for a negative error return which is always
going to be false. Fix this by making gpuidx an int32_t. This makes
gpuidx also type consistent with the use of gpuidx from the callers.

Addresses-Coverity: ("Unsigned compared against 0")
Fixes: 40afdb703f1c ("drm/amdkfd: refine migration policy with xnack on")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Reviewed-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Felix Kuehling <Felix.Kuehling@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
drivers/gpu/drm/amd/amdkfd/kfd_svm.c