diff options
author | Dave Airlie <[email protected]> | 2017-03-06 15:40:16 +1000 |
---|---|---|
committer | Dave Airlie <[email protected]> | 2017-03-07 08:17:03 +1000 |
commit | 6bae1e44a99f909359879951743599e6d6c1cc28 (patch) | |
tree | 03a9774f0bc4f1db17bef5551a47bb1126fe86a3 /src | |
parent | 5c45d2051a7872675982242849bfdefaaa275707 (diff) |
radv: Properly handle destroying NULL devices and instances
Ported from anv:
3d33a23e anv: Properly handle destroying NULL devices and instances
Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/amd/vulkan/radv_device.c | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c index 58f37c631f8..ab04473b01c 100644 --- a/src/amd/vulkan/radv_device.c +++ b/src/amd/vulkan/radv_device.c @@ -365,6 +365,9 @@ void radv_DestroyInstance( { RADV_FROM_HANDLE(radv_instance, instance, _instance); + if (!instance) + return; + for (int i = 0; i < instance->physicalDeviceCount; ++i) { radv_physical_device_finish(instance->physicalDevices + i); } @@ -988,6 +991,9 @@ void radv_DestroyDevice( { RADV_FROM_HANDLE(radv_device, device, _device); + if (!device) + return; + if (device->trace_bo) device->ws->buffer_destroy(device->trace_bo); |