radv: Do not close fd -1 when NULL-winsys creation fails.

Fixes: cd6ec2b1ab "radv: implement a dummy winsys for creating devices without AMDGPU"
Reviewed-by: Samuel Pitoiset <samuel.pitoiset@gmail.com>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/5181>
(cherry picked from commit a51ab5f956)
This commit is contained in:
Bas Nieuwenhuizen 2020-05-23 02:36:03 +02:00 committed by Eric Engestrom
parent 9f86183f50
commit 5dabdf3eef
2 changed files with 3 additions and 2 deletions

View file

@ -859,7 +859,7 @@
"description": "radv: Do not close fd -1 when NULL-winsys creation fails.",
"nominated": true,
"nomination_type": 1,
"resolution": 0,
"resolution": 1,
"master_sha": null,
"because_sha": "cd6ec2b1abbd96f4456e92613c2232c919bb9023"
},

View file

@ -407,7 +407,8 @@ radv_physical_device_init(struct radv_physical_device *device,
return VK_SUCCESS;
fail:
close(fd);
if (fd != -1)
close(fd);
if (master_fd != -1)
close(master_fd);
return result;