Mesa (main): radv: remove never reached free() when compiling shaders

GitLab Mirror gitlab-mirror at kemper.freedesktop.org
Thu Dec 2 07:39:17 UTC 2021


Module: Mesa
Branch: main
Commit: dd66de6017096d9f54f224b252fecb137f93263c
URL:    http://cgit.freedesktop.org/mesa/mesa/commit/?id=dd66de6017096d9f54f224b252fecb137f93263c

Author: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Date:   Fri Nov  5 13:30:44 2021 +0100

radv: remove never reached free() when compiling shaders

binary_out is never NULL and binaries are freed from the pipeline
after they are added to the cache.

Signed-off-by: Samuel Pitoiset <samuel.pitoiset at gmail.com>
Reviewed-by: Bas Nieuwenhuizen <bas at basnieuwenhuizen.nl>
Part-of: <https://gitlab.freedesktop.org/mesa/mesa/-/merge_requests/13690>

---

 src/amd/vulkan/radv_shader.c | 6 +-----
 1 file changed, 1 insertion(+), 5 deletions(-)

diff --git a/src/amd/vulkan/radv_shader.c b/src/amd/vulkan/radv_shader.c
index 9f6c786d65b..432c70bdd99 100644
--- a/src/amd/vulkan/radv_shader.c
+++ b/src/amd/vulkan/radv_shader.c
@@ -1846,11 +1846,7 @@ shader_compile(struct radv_device *device, struct vk_shader_module *module,
    /* Copy the shader binary configuration to store it in the cache. */
    memcpy(&binary->config, &shader->config, sizeof(binary->config));
 
-   if (binary_out)
-      *binary_out = binary;
-   else
-      free(binary);
-
+   *binary_out = binary;
    return shader;
 }
 



More information about the mesa-commit mailing list