Skip to content

Commit

Permalink
drm/amdgpu: fix unsigned variable instance compared to less than zero
Browse files Browse the repository at this point in the history
Currenly the error check on variable instance is always false because
it is a uint32_t type and this is never less than zero. Fix this by
making it an int type.

Addresses-Coverity: ("Unsigned compared against 0")
Fixes: 7d0e632 ("drm/amdgpu: update more sdma instances irq support")
Signed-off-by: Colin Ian King <colin.king@canonical.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
  • Loading branch information
Colin Ian King authored and Alex Deucher committed Aug 2, 2019
1 parent f0ced3f commit ac4bf4a
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion drivers/gpu/drm/amd/amdgpu/sdma_v4_0.c
Original file line number Diff line number Diff line change
Expand Up @@ -1963,7 +1963,8 @@ static int sdma_v4_0_process_ras_data_cb(struct amdgpu_device *adev,
struct ras_err_data *err_data,
struct amdgpu_iv_entry *entry)
{
uint32_t instance, err_source;
uint32_t err_source;
int instance;

instance = sdma_v4_0_irq_id_to_seq(entry->client_id);
if (instance < 0)
Expand Down

0 comments on commit ac4bf4a

Please sign in to comment.