radv: don't leak the fd if radv_physical_device_init() succeeds
authorEmil Velikov <emil.velikov@collabora.com>
Thu, 24 Nov 2016 20:30:44 +0000 (20:30 +0000)
committerEmil Velikov <emil.l.velikov@gmail.com>
Mon, 28 Nov 2016 19:51:22 +0000 (19:51 +0000)
radv_amdgpu_winsys_create() does not take ownership of the fd, thus we
end up leaking it as we return with VK_SUCCESS.

Cc: Dave Airlie <airlied@redhat.com>
Cc: "13.0" <mesa-stable@lists.freedesktop.org>
Signed-off-by: Emil Velikov <emil.velikov@collabora.com>
Reviewed-by: Bas Nieuwenhuizen <bas@basnieuwenhuizen.nl>
src/amd/vulkan/radv_device.c

index f89fc9dde572472026077a762d1328e7dcbece74..0dbb3f8a07dbe62671a6215a2508c70fe457edb5 100644 (file)
@@ -130,6 +130,7 @@ radv_physical_device_init(struct radv_physical_device *device,
 
        fprintf(stderr, "WARNING: radv is not a conformant vulkan implementation, testing use only.\n");
        device->name = device->rad_info.name;
+       close(fd);
        return VK_SUCCESS;
 
 fail: