Skip to content

Commit

Permalink
drm/exynos: Fix potential NULL pointer dereference
Browse files Browse the repository at this point in the history
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 <sachin.kamat@linaro.org>
Signed-off-by: Inki Dae <inki.dae@samsung.com>
Signed-off-by: Kyungmin Park <kyungmin.park@samsung.com>
  • Loading branch information
Sachin Kamat authored and Inki Dae committed Dec 5, 2012
1 parent dc62553 commit df3d90e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/gpu/drm/exynos/exynos_drm_g2d.c
Original file line number Diff line number Diff line change
Expand Up @@ -319,8 +319,8 @@ static void g2d_userptr_put_dma_addr(struct drm_device *drm_dev,
g2d_userptr->sgt = NULL;

kfree(g2d_userptr->pages);
kfree(g2d_userptr);
g2d_userptr->pages = NULL;
kfree(g2d_userptr);
g2d_userptr = NULL;
}

Expand Down

0 comments on commit df3d90e

Please sign in to comment.