From df3d90e5f3f09e5bc940250e2a90a7e15343a4b6 Mon Sep 17 00:00:00 2001 From: Sachin Kamat Date: Fri, 23 Nov 2012 09:11:59 +0530 Subject: [PATCH] drm/exynos: Fix potential NULL pointer dereference Pointer was being dereferenced after freeing. Fixes the following error: drivers/gpu/drm/exynos/exynos_drm_g2d.c:323 g2d_userptr_put_dma_addr() error: dereferencing freed memory 'g2d_userptr' Signed-off-by: Sachin Kamat Signed-off-by: Inki Dae Signed-off-by: Kyungmin Park --- drivers/gpu/drm/exynos/exynos_drm_g2d.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/gpu/drm/exynos/exynos_drm_g2d.c b/drivers/gpu/drm/exynos/exynos_drm_g2d.c index c1054cb2fe06..6ffa0763c078 100644 --- a/drivers/gpu/drm/exynos/exynos_drm_g2d.c +++ b/drivers/gpu/drm/exynos/exynos_drm_g2d.c @@ -319,8 +319,8 @@ out: g2d_userptr->sgt = NULL; kfree(g2d_userptr->pages); - kfree(g2d_userptr); g2d_userptr->pages = NULL; + kfree(g2d_userptr); g2d_userptr = NULL; } -- 2.20.1