[Mesa-stable] [Mesa-dev] [PATCH 7/8] radv: don't leak the fd if radv_physical_device_init() succeeds

Bas Nieuwenhuizen bas at basnieuwenhuizen.nl
Thu Nov 24 22:24:26 UTC 2016


Seems like libdrm_amdgpu does a dup indeed. Patches 7-8 are

Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>

On Thu, Nov 24, 2016 at 9:30 PM, Emil Velikov <emil.l.velikov at gmail.com> wrote:
> From: Emil Velikov <emil.velikov at collabora.com>
>
> 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 at redhat.com>
> Cc: "13.0" <mesa-stable at lists.freedesktop.org>
> Signed-off-by: Emil Velikov <emil.velikov at collabora.com>
> ---
> Not 100% sure on this one.
> ---
>  src/amd/vulkan/radv_device.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c
> index 1b8864d..a08f6ac 100644
> --- a/src/amd/vulkan/radv_device.c
> +++ b/src/amd/vulkan/radv_device.c
> @@ -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:
> --
> 2.10.2
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-stable mailing list