diff options
author | Samuel Pitoiset <[email protected]> | 2018-08-15 15:28:43 +0200 |
---|---|---|
committer | Samuel Pitoiset <[email protected]> | 2018-08-15 16:20:58 +0200 |
commit | 85113c4d0507f91dd773b555b8e3f75423275010 (patch) | |
tree | 907c10a5394b153b5ce3be9b13d087858b5e8b24 /src | |
parent | 17e79865cf3c8be2a710427a0a5c9b3bafeddf78 (diff) |
radv: fix memory leaks in radv_load_meta_pipeline()
Reported by Coverity.
Fixes: fbcd167314 ("radv: Add on-demand compilation of built-in shaders.")
Signed-off-by: Samuel Pitoiset <[email protected]>
Reviewed-by: Bas Nieuwenhuizen <[email protected]>
Diffstat (limited to 'src')
-rw-r--r-- | src/amd/vulkan/radv_meta.c | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/amd/vulkan/radv_meta.c b/src/amd/vulkan/radv_meta.c index ccdcb9ceb07..b8d0a7cfc70 100644 --- a/src/amd/vulkan/radv_meta.c +++ b/src/amd/vulkan/radv_meta.c @@ -263,6 +263,7 @@ radv_load_meta_pipeline(struct radv_device *device) char path[PATH_MAX + 1]; struct stat st; void *data = NULL; + bool ret = false; if (!radv_builtin_cache_path(path)) return false; @@ -278,11 +279,11 @@ radv_load_meta_pipeline(struct radv_device *device) if(read(fd, data, st.st_size) == -1) goto fail; - return radv_pipeline_cache_load(&device->meta_state.cache, data, st.st_size); + ret = radv_pipeline_cache_load(&device->meta_state.cache, data, st.st_size); fail: free(data); close(fd); - return false; + return ret; } static void |