From: hyesoo.yu Date: Fri, 8 Sep 2017 05:33:48 +0000 (+0900) Subject: [COMMON] g2d: fix to access the NULL pointer X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=2b7f34a85dff244409d7121c2cf9c5b5f94f1506;p=GitHub%2FLineageOS%2Fandroid_kernel_motorola_exynos9610.git [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 --- 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);