summaryrefslogtreecommitdiffstats
path: root/src/amd/vulkan/radv_device.c
diff options
context:
space:
mode:
authorDave Airlie <[email protected]>2016-10-12 08:52:56 +1000
committerDave Airlie <[email protected]>2016-10-12 08:53:44 +1000
commit6215b476482fa3a76d3245d88ab127a7c060e115 (patch)
tree59708503178b4474f7ad9647e70693cb95d5cf3f /src/amd/vulkan/radv_device.c
parente0641c61ca5cb8bba2e4cb5a0a6eede74f11ebc6 (diff)
radv: fix memory leak from physical device if wsi fails
Inspired by patch from Edward O'Callaghan <[email protected]> which didn't do it right. Signed-off-by: Dave Airlie <[email protected]>
Diffstat (limited to 'src/amd/vulkan/radv_device.c')
-rw-r--r--src/amd/vulkan/radv_device.c4
1 files changed, 3 insertions, 1 deletions
diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c
index 8c59344a3c8..79ef8ed55db 100644
--- a/src/amd/vulkan/radv_device.c
+++ b/src/amd/vulkan/radv_device.c
@@ -74,8 +74,10 @@ radv_physical_device_init(struct radv_physical_device *device,
}
device->ws->query_info(device->ws, &device->rad_info);
result = radv_init_wsi(device);
- if (result != VK_SUCCESS)
+ if (result != VK_SUCCESS) {
+ device->ws->destroy(device->ws);
goto fail;
+ }
fprintf(stderr, "WARNING: radv is not a conformant vulkan implementation, testing use only.\n");
device->name = device->rad_info.name;