Earlier commit added an extra dup(fd) to fix a ZaphodHeads issue. Although it did not consider the (very unlikely) case where we might end up with the valid fd == 0.
Fixes: 28dda47ae4d(winsys/radeon: Use dup fd as key in drm-winsys hash table to fix ZaphodHeads.) Cc: Mario Kleiner <mario.kleiner...@gmail.com> Signed-off-by: Emil Velikov <emil.l.veli...@gmail.com> --- Perhaps we should CC mesa-stable as the offending commit, yet considering how unlikely the above case is I'm ambivalent, -Emil src/gallium/winsys/radeon/drm/radeon_drm_winsys.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c b/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c index 41f8826..f7784fb 100644 --- a/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c +++ b/src/gallium/winsys/radeon/drm/radeon_drm_winsys.c @@ -493,7 +493,7 @@ static void radeon_winsys_destroy(struct radeon_winsys *rws) radeon_surface_manager_free(ws->surf_man); } - if (ws->fd) + if (ws->fd >= 0) close(ws->fd); FREE(rws); @@ -786,7 +786,7 @@ fail: ws->kman->destroy(ws->kman); if (ws->surf_man) radeon_surface_manager_free(ws->surf_man); - if (ws->fd) + if (ws->fd >= 0) close(ws->fd); FREE(ws); -- 2.4.5 _______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org http://lists.freedesktop.org/mailman/listinfo/mesa-dev