mirror of
https://gitlab.freedesktop.org/mesa/mesa.git
synced 2026-01-06 15:20:17 +01:00
anv: Don't teardown uninitialized anv_physical_device
If the user called vkDestroyDevice but never called vkEnumeratePhysicalDevices, then the driver tried to ralloc_free() an unitialized anv_physical_device. Fixes test 'dEQP-VK.api.device_init.create_instance_name_version'.
This commit is contained in:
parent
c8572d0f9c
commit
0ab926dfbf
1 changed files with 6 additions and 1 deletions
|
|
@ -224,7 +224,12 @@ void anv_DestroyInstance(
|
|||
{
|
||||
ANV_FROM_HANDLE(anv_instance, instance, _instance);
|
||||
|
||||
anv_physical_device_finish(&instance->physicalDevice);
|
||||
if (instance->physicalDeviceCount > 0) {
|
||||
/* We support at most one physical device. */
|
||||
assert(instance->physicalDeviceCount == 1);
|
||||
anv_physical_device_finish(&instance->physicalDevice);
|
||||
}
|
||||
|
||||
anv_finish_wsi(instance);
|
||||
|
||||
VG(VALGRIND_DESTROY_MEMPOOL(instance));
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue