hk: don't leak GS subparts in an error path

Signed-off-by: Alyssa Rosenzweig <alyssa@rosenzweig.io>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/31532>
This commit is contained in:
Alyssa Rosenzweig 2024-09-06 19:36:17 -04:00 committed by Marge Bot
parent 568f0a81c6
commit 6f3c1c909b

View file

@ -1028,7 +1028,14 @@ hk_compile_shader(struct hk_device *dev, struct vk_shader_compile_info *info,
variants[v].out, sw_stage, true, NULL);
if (result != VK_SUCCESS) {
hk_api_shader_destroy(&dev->vk, &obj->vk, pAllocator);
ralloc_free(nir);
if (clone != nir) {
ralloc_free(nir);
}
ralloc_free(clone);
ralloc_free(pre_gs);
ralloc_free(count);
ralloc_free(rast);
return result;
}
}