modesetting: set driverPrivate to NULL after closing fd.

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>
This commit is contained in:
Dave Airlie 2016-04-29 14:01:31 +10:00 committed by Adam Jackson
parent fc1f61b75c
commit a41a171bcb

View File

@ -635,7 +635,6 @@ FreeRec(ScrnInfoPtr pScrn)
ms = modesettingPTR(pScrn); ms = modesettingPTR(pScrn);
if (!ms) if (!ms)
return; return;
pScrn->driverPrivate = NULL;
if (ms->fd > 0) { if (ms->fd > 0) {
modesettingEntPtr ms_ent; modesettingEntPtr ms_ent;
@ -656,6 +655,7 @@ FreeRec(ScrnInfoPtr pScrn)
ms_ent->fd = 0; ms_ent->fd = 0;
} }
} }
pScrn->driverPrivate = NULL;
free(ms->drmmode.Options); free(ms->drmmode.Options);
free(ms); free(ms);