2
0
mirror of git://git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git synced 2025-09-04 20:19:47 +08:00

drm/amdgpu/userq: fix error handling of invalid doorbell

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 <David.Wu3@amd.com>
Signed-off-by: Alex Deucher <alexander.deucher@amd.com>
(cherry picked from commit 7e2a5b0a9a165a7c51274aa01b18be29491b4345)
Cc: stable@vger.kernel.org
This commit is contained in:
Alex Deucher 2025-08-22 12:12:37 -04:00
parent ee38ea0ae4
commit c767d74a9c

View File

@ -471,6 +471,7 @@ amdgpu_userq_create(struct drm_file *filp, union drm_amdgpu_userq *args)
if (index == (uint64_t)-EINVAL) { if (index == (uint64_t)-EINVAL) {
drm_file_err(uq_mgr->file, "Failed to get doorbell for queue\n"); drm_file_err(uq_mgr->file, "Failed to get doorbell for queue\n");
kfree(queue); kfree(queue);
r = -EINVAL;
goto unlock; goto unlock;
} }