drm/amdgpu: Fix runtime PM leak in amdgpu_securedisplay_debugfs_write()
Subsystems (3)
PATCH 1/1 drm/amdgpu: Fix runtime PM leak in amdgpu_securedisplay_debugfs_write()
amdgpu_securedisplay_debugfs_write() resumes the device with pm_runtime_get_sync() before parsing the debugfs input. In the SECUREDISPLAY send ROI CRC case, an invalid user input, i.e. a missing or out of range phy_id, makes the function return -EINVAL without calling pm_runtime_put_autosuspend(), leaking the runtime PM reference and keeping the GPU awake.
Drop the runtime PM reference on the invalid input error path before returning.
--- drivers/gpu/drm/amd/amdgpu/amdgpu_securedisplay.c | 1 + 1 file changed, 1 insertion(+)
drivers/gpu/drm/amd/amdgpu/amdgpu_securedisplay.c +1 -0
@@ -137,6 +137,7 @@ static ssize_t amdgpu_securedisplay_debugfs_write(struct file *f, const char __ucase 2 :if (size <3 || phy_id >=TA_SECUREDISPLAY_MAX_PHY ) {dev_err (adev->dev,"Invalid input: %s\n" , str); +pm_runtime_put_autosuspend (dev->dev);return -EINVAL ; }mutex_lock (&psp->securedisplay_context.mutex);
Signature · 1 line
2.34.1
Deucher, Alexander
maintainerPublic
Quoted 19 lines
-----Original Message-----
From: Wentao Liang <[email protected]>
Sent: Wednesday, September 16, 2026 5:59 AM
To: Ma, Jun <[email protected]>
Cc: [email protected]; Deucher, Alexander <[email protected]>; [email protected]; Koenig, Christian <[email protected]>; [email protected]; linux- [email protected]; [email protected]; Wentao Liang <[email protected]>; [email protected]
Subject: [PATCH] drm/amdgpu: Fix runtime PM leak inamdgpu_securedisplay_debugfs_write()
amdgpu_securedisplay_debugfs_write()resumes the device withpm_runtime_get_sync()before parsing the debugfs input. In the SECUREDISPLAY send ROI CRC case, an invalid user input, i.e. a missing or out of rangephy_id, makes the function return-EINVALwithout callingpm_runtime_put_autosuspend(), leaking the runtime PM reference and keeping the GPU awake.
Quoted 6 lines
Drop the runtime PM reference on the invalid input error path before returning.
Fixes 7e39d7ec3588 ("drm/amdgpu: Fix the uninitialized variable warning")Signed-off-by Wentao Liang <[email protected]>
This was already fixed.
Thanks,
Alex
Quoted 20 lines
--- drivers/gpu/drm/amd/amdgpu/amdgpu_securedisplay.c | 1 + 1 file changed, 1 insertion(+)drivers/gpu/drm/amd/amdgpu/amdgpu_securedisplay.c +0
-0@@ -137,6 +137,7 @@ static ssize_tamdgpu_securedisplay_debugfs_write(struct file *f, const char
__ucase 2: if (size < 3 || phy_id >= TA_SECUREDISPLAY_MAX_PHY) { dev_err(adev->dev, "Invalid input: %s\n", str); + pm_runtime_put_autosuspend(dev->dev); return -EINVAL; } mutex_lock(&psp->securedisplay_context.mutex);--
2.34.1