aboutsummaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorJason Ekstrand <[email protected]>2017-03-01 08:39:49 -0800
committerEmil Velikov <[email protected]>2017-03-16 01:34:01 +0000
commitd1f01d89e177ec51056b819c0aa71d49443e9fb8 (patch)
treee960ac06418afdebbb4096b953dcddfa4813b5b2 /src
parent0d7d4f973d17d74ea9a177c09a0b70bf7370b190 (diff)
anv: Properly handle destroying NULL devices and instances
Reviewed-by: Lionel Landwerlin <[email protected]> Cc: "17.0 13.0" <[email protected]> (cherry picked from commit e3d33a23e6cbe2b73b412a56bb4fc4aa6852d081)
Diffstat (limited to 'src')
-rw-r--r--src/intel/vulkan/anv_device.c6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/intel/vulkan/anv_device.c b/src/intel/vulkan/anv_device.c
index 67323e08860..d7235ed0dba 100644
--- a/src/intel/vulkan/anv_device.c
+++ b/src/intel/vulkan/anv_device.c
@@ -362,6 +362,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);
@@ -1006,6 +1009,9 @@ void anv_DestroyDevice(
{
ANV_FROM_HANDLE(anv_device, device, _device);
+ if (!device)
+ return;
+
anv_device_finish_blorp(device);
anv_queue_finish(&device->queue);