[COMMON] g2d: fix to access the NULL pointer
authorhyesoo.yu <hyesoo.yu@samsung.com>
Fri, 8 Sep 2017 05:33:48 +0000 (14:33 +0900)
committerSeungchul Kim <sc377.kim@samsung.com>
Mon, 28 May 2018 05:27:46 +0000 (14:27 +0900)
Fix referencing a pointer that might be null &mm->mmap_sem
when calling down_read

Change-Id: I5e960fac24e6218f0ef71fe33d8e72bfa119d268
Signed-off-by: hyesoo.yu <hyesoo.yu@samsung.com>
drivers/gpu/exynos/g2d/g2d_uapi_process.c

index 41f874c9b36e7994290ed52287fe3299783a2388..f7b74ee46eaf45b4ef020c11807e956b5129447c 100644 (file)
@@ -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);