Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit cf6f1d39 authored by Christian König's avatar Christian König Committed by Alex Deucher
Browse files

drm/amdgpu: fix signed overrun in amdgpu_ctx_get_fence



Otherwise the first 16 fences of a context will always signal immediately.

Signed-off-by: default avatarChristian König <christian.koenig@amd.com>
Reviewed-by: default avatarJammy Zhou <Jammy.Zhou@amd.com>
parent cdecb65b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -226,7 +226,7 @@ struct fence *amdgpu_ctx_get_fence(struct amdgpu_ctx *ctx,
		return ERR_PTR(-EINVAL);
	}

	if (seq < cring->sequence - AMDGPU_CTX_MAX_CS_PENDING) {
	if (seq + AMDGPU_CTX_MAX_CS_PENDING < cring->sequence) {
		spin_unlock(&ctx->ring_lock);
		return NULL;
	}