mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-05-05 00:58:05 +02:00
winsys/radeon: don't leak the fd when it is 0
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: 10.6 <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.l.velikov@gmail.com>
Reviewed-by: Alex Deucher <alexander.deucher@amd.com>
Reviewed-by: Mario Kleiner <mario.kleiner.de@gmail.com>
(cherry picked from commit 1307be519b)
This commit is contained in:
parent
d8116f8ec5
commit
b70176d96b
1 changed files with 2 additions and 2 deletions
|
|
@ -489,7 +489,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);
|
||||
|
|
@ -778,7 +778,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);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue