aboutsummaryrefslogtreecommitdiffstats
path: root/src/gallium/state_trackers/xorg/xorg_driver.c
diff options
context:
space:
mode:
authorMichel Dänzer <[email protected]>2009-10-01 16:45:11 +0200
committerMichel Dänzer <[email protected]>2009-10-01 16:45:11 +0200
commite32a341be66391e0ea1cc6ce19bbd57997f46b6b (patch)
tree2fcf6429af6314422d220afff0786cbd8a871449 /src/gallium/state_trackers/xorg/xorg_driver.c
parent0b466c8705c9000c347760b5daafdf31c291736d (diff)
st/xorg: Check that ms->api->destroy is not NULL before calling it.
Fixes potential crash on X server shutdown.
Diffstat (limited to 'src/gallium/state_trackers/xorg/xorg_driver.c')
-rw-r--r--src/gallium/state_trackers/xorg/xorg_driver.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/gallium/state_trackers/xorg/xorg_driver.c b/src/gallium/state_trackers/xorg/xorg_driver.c
index 8c4cba035a1..4bc87aa613d 100644
--- a/src/gallium/state_trackers/xorg/xorg_driver.c
+++ b/src/gallium/state_trackers/xorg/xorg_driver.c
@@ -726,8 +726,10 @@ CloseScreen(int scrnIndex, ScreenPtr pScreen)
if (ms->exa)
xorg_exa_close(pScrn);
+ if (ms->api->destroy)
ms->api->destroy(ms->api);
- ms->api = NULL;
+ ms->api = NULL;
+
drmClose(ms->fd);
ms->fd = -1;