[Mesa-dev] [PATCH] radv: don't leak DRM devices

Bas Nieuwenhuizen bas at basnieuwenhuizen.nl
Tue May 2 20:52:17 UTC 2017


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

On Tue, May 2, 2017 at 7:17 PM, Grazvydas Ignotas <notasas at gmail.com> wrote:
> After successful drmGetDevices2() call, drmFreeDevices() needs to be
> called.
>
> Fixes: 743315f2 "radv: do not open random render node(s)"
> Signed-off-by: Grazvydas Ignotas <notasas at gmail.com>
> ---
>  src/amd/vulkan/radv_device.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c
> index 214b2e0..4b27fd0 100644
> --- a/src/amd/vulkan/radv_device.c
> +++ b/src/amd/vulkan/radv_device.c
> @@ -415,13 +415,15 @@ radv_enumerate_devices(struct radv_instance *instance)
>                                                            instance,
>                                                            devices[i]->nodes[DRM_NODE_RENDER]);
>                         if (result == VK_SUCCESS)
>                                 ++instance->physicalDeviceCount;
>                         else if (result != VK_ERROR_INCOMPATIBLE_DRIVER)
> -                               return result;
> +                               break;
>                 }
>         }
> +       drmFreeDevices(devices, max_devices);
> +
>         return result;
>  }
>
>  VkResult radv_EnumeratePhysicalDevices(
>         VkInstance                                  _instance,
> --
> 2.7.4
>
> _______________________________________________
> mesa-dev mailing list
> mesa-dev at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/mesa-dev


More information about the mesa-dev mailing list