[PATCH 05/25] plugins/amdgpu: Fix logging of failures to open files during restore init

Tvrtko Ursulin <[email protected]> Wed, 11 Mar 2026 09:58:54 +0000
Newsgroups dev.linux.lists.criu
Message-ID <[email protected]>
Currently failure to open files logs an unitialized stack string as the
failed path. Lets just log the basename and drop the unused stack buffer.

Signed-off-by: Tvrtko Ursulin <[email protected]>
Reviewed-By: David Francis <[email protected]>
---
 plugins/amdgpu/amdgpu_plugin.c | 5 ++---
 1 file changed, 2 insertions(+), 3 deletions(-)

diff --git a/plugins/amdgpu/amdgpu_plugin.c b/plugins/amdgpu/amdgpu_plugin.c
index 65f3083cd597..ad5937b942b6 100644
--- a/plugins/amdgpu/amdgpu_plugin.c
+++ b/plugins/amdgpu/amdgpu_plugin.c
@@ -1128,7 +1128,6 @@ int amdgpu_restore_init(void)
 		int ret;
 		unsigned char *buf;
 		int num_handles = 0;
-		char img_path[PATH_MAX];
 		CriuRenderNode *rd = NULL;
 		CriuKfd *e = NULL;
 
@@ -1147,7 +1146,7 @@ int amdgpu_restore_init(void)
 
 					ret = read_fp(img_fp, buf, img_size);
 					if (ret) {
-						pr_perror("Unable to read from %s", img_path);
+						pr_perror("Unable to read from %s", dir->d_name);
 						fclose(img_fp);
 						xfree(buf);
 						return ret;
@@ -1169,7 +1168,7 @@ int amdgpu_restore_init(void)
 
 					ret = read_fp(img_fp, buf, img_size);
 					if (ret) {
-						pr_perror("Unable to read from %s", img_path);
+						pr_perror("Unable to read from %s", dir->d_name);
 						fclose(img_fp);
 						xfree(buf);
 						return ret;
-- 
2.52.0