提交 cf6f1d39 编写于 作者: C Christian König 提交者: Alex Deucher

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: NChristian König <christian.koenig@amd.com>
Reviewed-by: NJammy Zhou <Jammy.Zhou@amd.com>
上级 cdecb65b
......@@ -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;
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册