[Mesa-dev] [PATCH] anv: Properly handle destroying NULL devices and instances

Lionel Landwerlin lionel.g.landwerlin at intel.com
Wed Mar 1 16:47:48 UTC 2017


Reviewed-by: Lionel Landwerlin <lionel.g.landwerlin at intel.com>

On 01/03/17 16:40, Jason Ekstrand wrote:
> Cc: "17.0 13.0" <mesa-dev at lists.freedesktop.org>
> ---
>   src/intel/vulkan/anv_device.c | 6 ++++++
>   1 file changed, 6 insertions(+)
>
> diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c
> index 5ac3c5d..736214b 100644
> --- a/src/intel/vulkan/anv_device.c
> +++ b/src/intel/vulkan/anv_device.c
> @@ -427,6 +427,9 @@ void anv_DestroyInstance(
>   {
>      ANV_FROM_HANDLE(anv_instance, instance, _instance);
>   
> +   if (!instance)
> +      return;
> +
>      if (instance->physicalDeviceCount > 0) {
>         /* We support at most one physical device. */
>         assert(instance->physicalDeviceCount == 1);
> @@ -1132,6 +1135,9 @@ void anv_DestroyDevice(
>   {
>      ANV_FROM_HANDLE(anv_device, device, _device);
>   
> +   if (!device)
> +      return;
> +
>      anv_device_finish_blorp(device);
>   
>      anv_queue_finish(&device->queue);




More information about the mesa-dev mailing list