mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2025-12-24 08:50:13 +01:00
venus: Do not use instance pointer before NULL check
Fixes: a753f50668 ("venus: break up vn_device.c")
Reviewed-by: Yiwei Zhang <zzyiwei@chromium.org>
Signed-off-by: Janne Grunau <j@jannau.net>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/34613>
This commit is contained in:
parent
7d3a99a46c
commit
39e4fd98ce
1 changed files with 4 additions and 2 deletions
|
|
@ -409,12 +409,14 @@ vn_DestroyInstance(VkInstance _instance,
|
|||
{
|
||||
VN_TRACE_FUNC();
|
||||
struct vn_instance *instance = vn_instance_from_handle(_instance);
|
||||
const VkAllocationCallbacks *alloc =
|
||||
pAllocator ? pAllocator : &instance->base.vk.alloc;
|
||||
const VkAllocationCallbacks *alloc = pAllocator;
|
||||
|
||||
if (!instance)
|
||||
return;
|
||||
|
||||
if (!alloc)
|
||||
alloc = &instance->base.vk.alloc;
|
||||
|
||||
if (instance->physical_device.initialized) {
|
||||
for (uint32_t i = 0; i < instance->physical_device.device_count; i++)
|
||||
vn_physical_device_fini(&instance->physical_device.devices[i]);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue