mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-29 04:50:26 +00:00
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 <tvrtko.ursulin@igalia.com> Reviewed-By: David Francis <David.Francis@amd.com>
This commit is contained in:
parent
b1281444a8
commit
e26ed51633
1 changed files with 4 additions and 5 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue