File U_modesetting-set-driverPrivate-to-Null-after-closing-fd.patch of Package xorg-x11-server
Git-commit: a41a171bcbae9aeafac2865faa904f15d9b59925
Author: Dave Airlie <airlied@gmail.com>
Subject: [PATCH] modesetting: set driverPrivate to NULL after closing fd.
Patch-Mainline: Upstream
References: bnc#1011570
Signed-off-by: Michal Srb <msrb@suse.com>
Otherwise ms_ent_priv will return NULL and things will fall apart.
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Signed-off-by: Dave Airlie <airlied@redhat.com>
diff --git a/hw/xfree86/drivers/modesetting/driver.c b/hw/xfree86/drivers/modesetting/driver.c
index c97f33a..abf7e1a 100644
--- a/hw/xfree86/drivers/modesetting/driver.c
+++ b/hw/xfree86/drivers/modesetting/driver.c
@@ -635,7 +635,6 @@ FreeRec(ScrnInfoPtr pScrn)
ms = modesettingPTR(pScrn);
if (!ms)
return;
- pScrn->driverPrivate = NULL;
if (ms->fd > 0) {
modesettingEntPtr ms_ent;
@@ -656,6 +655,7 @@ FreeRec(ScrnInfoPtr pScrn)
ms_ent->fd = 0;
}
}
+ pScrn->driverPrivate = NULL;
free(ms->drmmode.Options);
free(ms);