summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorKrishna Manikandan <mkrishn@codeaurora.org>2021-10-08 10:25:24 +0530
committerJoey Lin <linjoey@google.com>2022-01-27 09:00:29 +0000
commit0b3a4e11f9fa7bb9cbccfe7b9e1877664ae908ea (patch)
tree6210c10292deb60f60519515a925b888da4e162a
parent00edf9686a4a8c5866071940b03b2f1e197725d6 (diff)
downloaddisplay-drivers-0b3a4e11f9fa7bb9cbccfe7b9e1877664ae908ea.tar.gz
disp: msm: sde: protect file private structure with mutex lock
Access file private data structures inside the mutex lock only to avoid use-after-free issues . Bug:213239835 Change-Id: If70731f517bcb47d4515f131fecafe702064cb45 Signed-off-by: Krishna Manikandan <mkrishn@codeaurora.org> Signed-off-by: linjoey <linjoey@google.com>
-rw-r--r--msm/msm_drv.c3
1 files changed, 2 insertions, 1 deletions
diff --git a/msm/msm_drv.c b/msm/msm_drv.c
index 2b219cda..c3f58be9 100644
--- a/msm/msm_drv.c
+++ b/msm/msm_drv.c
@@ -1622,7 +1622,7 @@ void msm_mode_object_event_notify(struct drm_mode_object *obj,
static int msm_release(struct inode *inode, struct file *filp)
{
- struct drm_file *file_priv = filp->private_data;
+ struct drm_file *file_priv;
struct drm_minor *minor;
struct drm_device *dev;
struct msm_drm_private *priv;
@@ -1634,6 +1634,7 @@ static int msm_release(struct inode *inode, struct file *filp)
mutex_lock(&msm_release_lock);
+ file_priv = filp->private_data;
if (!file_priv) {
ret = -EINVAL;
goto end;