From 2b7f34a85dff244409d7121c2cf9c5b5f94f1506 Mon Sep 17 00:00:00 2001 From: "hyesoo.yu" Date: Fri, 8 Sep 2017 14:33:48 +0900 Subject: [PATCH] [COMMON] g2d: fix to access the NULL pointer Fix referencing a pointer that might be null &mm->mmap_sem when calling down_read Change-Id: I5e960fac24e6218f0ef71fe33d8e72bfa119d268 Signed-off-by: hyesoo.yu --- drivers/gpu/exynos/g2d/g2d_uapi_process.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/gpu/exynos/g2d/g2d_uapi_process.c b/drivers/gpu/exynos/g2d/g2d_uapi_process.c index 41f874c9b36e..f7b74ee46eaf 100644 --- a/drivers/gpu/exynos/g2d/g2d_uapi_process.c +++ b/drivers/gpu/exynos/g2d/g2d_uapi_process.c @@ -310,6 +310,8 @@ static int g2d_get_userptr(struct g2d_task *task, int prot = IOMMU_READ; mm = get_task_mm(current); + if (!mm) + return ret; down_read(&mm->mmap_sem); -- 2.20.1