Skip to content

Commit a64fc11

Browse files
jhovoldatseanpaul
authored andcommitted
drm/msm: fix memleak on release
If a process is interrupted while accessing the "gpu" debugfs file and the drm device struct_mutex is contended, release() could return early and fail to free related resources. Note that the return value from release() is ignored. Fixes: 4f776f4 ("drm/msm/gpu: Convert the GPU show function to use the GPU state") Cc: stable <[email protected]> # 4.18 Cc: Jordan Crouse <[email protected]> Cc: Rob Clark <[email protected]> Reviewed-by: Rob Clark <[email protected]> Signed-off-by: Johan Hovold <[email protected]> Signed-off-by: Sean Paul <[email protected]> Link: https://patchwork.freedesktop.org/patch/msgid/[email protected]
1 parent 3ca3a9e commit a64fc11

File tree

1 file changed

+1
-5
lines changed

1 file changed

+1
-5
lines changed

drivers/gpu/drm/msm/msm_debugfs.c

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -47,12 +47,8 @@ static int msm_gpu_release(struct inode *inode, struct file *file)
4747
struct msm_gpu_show_priv *show_priv = m->private;
4848
struct msm_drm_private *priv = show_priv->dev->dev_private;
4949
struct msm_gpu *gpu = priv->gpu;
50-
int ret;
51-
52-
ret = mutex_lock_interruptible(&show_priv->dev->struct_mutex);
53-
if (ret)
54-
return ret;
5550

51+
mutex_lock(&show_priv->dev->struct_mutex);
5652
gpu->funcs->gpu_state_put(show_priv->state);
5753
mutex_unlock(&show_priv->dev->struct_mutex);
5854

0 commit comments

Comments
 (0)