On 10/11/2016 10:04 PM, Emil Velikov wrote: > On 11 October 2016 at 10:50, Edward O'Callaghan > <funfunc...@folklore1984.net> wrote: >> The call to 'radv_amdgpu_winsys_create()' does a heap >> allocation and expects the call site to free it, however the >> fail path for 'radv_init_wsi()' fails to to do so. >> >> Signed-off-by: Edward O'Callaghan <funfunc...@folklore1984.net> >> --- >> src/amd/vulkan/radv_device.c | 5 ++++- >> 1 file changed, 4 insertions(+), 1 deletion(-) >> >> diff --git a/src/amd/vulkan/radv_device.c b/src/amd/vulkan/radv_device.c >> index 8c59344..f461ce1 100644 >> --- a/src/amd/vulkan/radv_device.c >> +++ b/src/amd/vulkan/radv_device.c >> @@ -74,8 +74,11 @@ 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) { >> + free(device->ws); > You need a proper API to teardown the winsys which complements > radv_amdgpu_winsys_create. As-is you're papering over the problem.
Good idea, I'll look into it now thanks for the suggestion. > > Furthermore the device contents should not be modified if the > {anv,radv}_physical_device_init function fails. Alright. > > -Emil >
signature.asc
Description: OpenPGP digital signature
_______________________________________________ mesa-dev mailing list mesa-dev@lists.freedesktop.org https://lists.freedesktop.org/mailman/listinfo/mesa-dev