From 2ff90f01b9c82b3b34758dee882f18f44f8e0b2f Mon Sep 17 00:00:00 2001 From: Radostin Stoyanov Date: Sun, 1 Oct 2023 08:58:59 +0100 Subject: [PATCH] amdgpu: fix clang warnings amdgpu_plugin.c:930:6: error: variable 'buffer' is used uninitialized whenever 'if' condition is true [-Werror,-Wsometimes-uninitialized] if (ret) { ^~~ amdgpu_plugin.c:988:8: note: uninitialized use occurs here xfree(buffer); Signed-off-by: Radostin Stoyanov --- plugins/amdgpu/amdgpu_plugin.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/plugins/amdgpu/amdgpu_plugin.c b/plugins/amdgpu/amdgpu_plugin.c index 2ebc5e1786..32ff8f9364 100644 --- a/plugins/amdgpu/amdgpu_plugin.c +++ b/plugins/amdgpu/amdgpu_plugin.c @@ -915,7 +915,7 @@ void *dump_bo_contents(void *_thread_data) int num_bos = 0; int i, ret = 0; FILE *bo_contents_fp = NULL; - void *buffer; + void *buffer = NULL; char img_path[40]; pr_info("Thread[0x%x] started\n", thread_data->gpu_id); @@ -1004,7 +1004,7 @@ void *restore_bo_contents(void *_thread_data) uint64_t max_copy_size; uint32_t major, minor; FILE *bo_contents_fp = NULL; - void *buffer; + void *buffer = NULL; char img_path[40]; int num_bos = 0; int i, ret = 0;