summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorPhilipp Brüschweiler <blei42@gmail.com>2012-08-15 18:14:44 +0200
committerKristian Høgsberg <krh@bitplanet.net>2012-08-16 13:17:06 -0400
commit0efd564a09988a4a7f49cab70b778026459dff1b (patch)
tree671ab2b44c259e098799c9f27707d66e79096b76
parent50dec637909cfe8fa53582f2f64ab261b123f092 (diff)
downloadmesa-0efd564a09988a4a7f49cab70b778026459dff1b.tar.gz
mesa-0efd564a09988a4a7f49cab70b778026459dff1b.tar.xz
mesa-0efd564a09988a4a7f49cab70b778026459dff1b.zip
wayland-drm: close fd after the display is uninitialized
This fixes a "kernel rejected pushbuf: Bad file descriptor" error on wl_drm display destruction. Reviewed-by: Kristian Høgsberg <krh@bitplanet.net>
-rw-r--r--src/gallium/state_trackers/egl/wayland/native_drm.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/src/gallium/state_trackers/egl/wayland/native_drm.c b/src/gallium/state_trackers/egl/wayland/native_drm.c
index 006b3d507a..c6f61978ab 100644
--- a/src/gallium/state_trackers/egl/wayland/native_drm.c
+++ b/src/gallium/state_trackers/egl/wayland/native_drm.c
@@ -71,8 +71,6 @@ wayland_drm_display_destroy(struct native_display *ndpy)
{
struct wayland_drm_display *drmdpy = wayland_drm_display(ndpy);
- if (drmdpy->fd)
- close(drmdpy->fd);
if (drmdpy->wl_drm)
wl_drm_destroy(drmdpy->wl_drm);
if (drmdpy->device_name)
@@ -84,6 +82,9 @@ wayland_drm_display_destroy(struct native_display *ndpy)
ndpy_uninit(ndpy);
+ if (drmdpy->fd)
+ close(drmdpy->fd);
+
FREE(drmdpy);
}