From: Alex Deucher Date: Fri, 22 Aug 2025 16:12:37 +0000 (-0400) Subject: drm/amdgpu/userq: fix error handling of invalid doorbell X-Git-Tag: v6.16.5~13 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=3f46d1d3028ed6facbf7a359cc36731ad1001b62;p=thirdparty%2Fkernel%2Fstable.git drm/amdgpu/userq: fix error handling of invalid doorbell commit c767d74a9cdd1042046d02319d16b85d9aa8a8aa upstream. If the doorbell is invalid, be sure to set the r to an error state so the function returns an error. Reviewed-by: David (Ming Qiang) Wu Signed-off-by: Alex Deucher (cherry picked from commit 7e2a5b0a9a165a7c51274aa01b18be29491b4345) Cc: stable@vger.kernel.org Signed-off-by: Greg Kroah-Hartman --- diff --git a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c index aac0de86f3e8c..a966ede1dba24 100644 --- a/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c +++ b/drivers/gpu/drm/amd/amdgpu/amdgpu_userq.c @@ -426,6 +426,7 @@ amdgpu_userq_create(struct drm_file *filp, union drm_amdgpu_userq *args) if (index == (uint64_t)-EINVAL) { drm_file_err(uq_mgr->file, "Failed to get doorbell for queue\n"); kfree(queue); + r = -EINVAL; goto unlock; }