From e26ed51633751a5468aede8d4bb9a6d2c1662433 Mon Sep 17 00:00:00 2001 From: Tvrtko Ursulin Date: Fri, 13 Feb 2026 08:54:59 +0000 Subject: [PATCH] plugins/amdgpu: Fix logging of failures to open files during restore init 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 Reviewed-By: David Francis --- plugins/amdgpu/amdgpu_plugin.c | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/plugins/amdgpu/amdgpu_plugin.c b/plugins/amdgpu/amdgpu_plugin.c index ac81113b1..c7eb210a8 100644 --- a/plugins/amdgpu/amdgpu_plugin.c +++ b/plugins/amdgpu/amdgpu_plugin.c @@ -1132,7 +1132,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; @@ -1154,7 +1153,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; @@ -1163,7 +1162,7 @@ int amdgpu_restore_init(void) fclose(img_fp); e = criu_kfd__unpack(NULL, img_size, buf); if (!e) { - pr_err("Unable to unpack %s!\n", img_path); + pr_err("Unable to unpack %s!\n", dir->d_name); xfree(buf); return -EINVAL; } @@ -1184,7 +1183,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; @@ -1193,7 +1192,7 @@ int amdgpu_restore_init(void) fclose(img_fp); rd = criu_render_node__unpack(NULL, img_size, buf); if (!rd) { - pr_err("Unable to unpack %s!\n", img_path); + pr_err("Unable to unpack %s!\n", dir->d_name); xfree(buf); return -EINVAL; }