From e197e97d67883cacd0f97f3d32fc37e1e5c2f9c0 Mon Sep 17 00:00:00 2001 From: Tobias Jakobi Date: Fri, 11 Jul 2014 00:39:12 +0200 Subject: [PATCH] exynos: disable crtc before freeing buffers The crtc should be disabled before deallocating the buffers, otherwise leading to a use-after-free scenario, which can trigger all sorts of funny effects. --- gfx/exynos_gfx.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/gfx/exynos_gfx.c b/gfx/exynos_gfx.c index 97ff24c755..8b3c8a5887 100644 --- a/gfx/exynos_gfx.c +++ b/gfx/exynos_gfx.c @@ -821,6 +821,10 @@ fail_alloc: static void exynos_free(struct exynos_data *pdata) { unsigned i; + /* Disable the CRTC. */ + drmModeSetCrtc(pdata->fd, pdata->drm->crtc_id, 0, + 0, 0, &pdata->drm->connector_id, 1, NULL); + clean_up_pages(pdata->pages, pdata->num_pages); free(pdata->pages);