[PATCH 3/6] modesetting: set driverPrivate to NULL after closing fd.

Dave Airlie airlied at gmail.com
Fri Apr 29 04:01:31 UTC 2016


Otherwise ms_ent_priv will return NULL and things will fall
apart.

Signed-off-by: Dave Airlie <airlied at redhat.com>
---
 hw/xfree86/drivers/modesetting/driver.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/hw/xfree86/drivers/modesetting/driver.c b/hw/xfree86/drivers/modesetting/driver.c
index fbc1611..c3e6aec 100644
--- a/hw/xfree86/drivers/modesetting/driver.c
+++ b/hw/xfree86/drivers/modesetting/driver.c
@@ -624,7 +624,6 @@ FreeRec(ScrnInfoPtr pScrn)
     ms = modesettingPTR(pScrn);
     if (!ms)
         return;
-    pScrn->driverPrivate = NULL;
 
     if (ms->fd > 0) {
         modesettingEntPtr ms_ent;
@@ -645,6 +644,7 @@ FreeRec(ScrnInfoPtr pScrn)
             ms_ent->fd = 0;
         }
     }
+    pScrn->driverPrivate = NULL;
     free(ms->drmmode.Options);
     free(ms);
 
-- 
2.5.5



More information about the xorg-devel mailing list