When the runtime resume failed, then the runtime uage decreased at
free_mqd. So the runtime resume error handler doesn't need to decrease
the runtime usage separately.

Fixes: 4baa0dcac737 ("drm/amdgpu: validate return value of pm_runtime_get_sync")
Signed-off-by: Prike Liang <prike.li...@amd.com>
---
 drivers/gpu/drm/amd/amdgpu/mes_userqueue.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

diff --git a/drivers/gpu/drm/amd/amdgpu/mes_userqueue.c 
b/drivers/gpu/drm/amd/amdgpu/mes_userqueue.c
index 35ae4125cd83..b469b800119f 100644
--- a/drivers/gpu/drm/amd/amdgpu/mes_userqueue.c
+++ b/drivers/gpu/drm/amd/amdgpu/mes_userqueue.c
@@ -291,8 +291,7 @@ static int mes_userq_mqd_create(struct amdgpu_userq_mgr 
*uq_mgr,
        r = pm_runtime_get_sync(adev_to_drm(adev)->dev);
        if (r < 0) {
                dev_err(adev->dev, "pm_runtime_get_sync() failed for userqueue 
mqd create\n");
-               pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
-               goto free_mqd;
+               goto deference_pm;
        }
 
        r = mqd_hw_default->init_mqd(adev, (void *)queue->mqd.cpu_ptr, 
userq_props);
@@ -330,6 +329,7 @@ static int mes_userq_mqd_create(struct amdgpu_userq_mgr 
*uq_mgr,
 free_mqd:
        amdgpu_userqueue_destroy_object(uq_mgr, &queue->mqd);
        pm_runtime_mark_last_busy(adev_to_drm(adev)->dev);
+deference_pm:
        pm_runtime_put_autosuspend(adev_to_drm(adev)->dev);
 
 free_props:
-- 
2.34.1

Reply via email to