[Mesa-dev] [PATCH] wayland-drm: close fd after the display is uninitialized

Kristian Høgsberg hoegsberg at gmail.com
Thu Aug 16 10:18:50 PDT 2012


On Wed, Aug 15, 2012 at 06:14:44PM +0200, Philipp Brüschweiler wrote:
> This fixes a "kernel rejected pushbuf: Bad file descriptor" error on
> wl_drm display destruction.

Thanks, that looks good, applied.

Kristian

> ---
>  src/gallium/state_trackers/egl/wayland/native_drm.c | 5 +++--
>  1 Datei geändert, 3 Zeilen hinzugefügt(+), 2 Zeilen entfernt(-)
> 
> diff --git a/src/gallium/state_trackers/egl/wayland/native_drm.c b/src/gallium/state_trackers/egl/wayland/native_drm.c
> index 006b3d5..c6f6197 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);
>  }
>  
> -- 
> 1.7.11.4
> 
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> http://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list