mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-23 10:09:57 +00:00
plugin/amdgpu: set errno in open_img_file() on read/write failure
open_img_file() can return NULL after a read_fp() or write_fp() failure without setting errno. The openat() and fdopen() paths set errno, but the read/write path does not, so callers using -errno get zero or a stale value. Set errno to EIO on this path so errno is always valid when the function returns NULL. Signed-off-by: Radostin Stoyanov <rstoyanov@fedoraproject.org>
This commit is contained in:
parent
0377c41261
commit
199f71f620
1 changed files with 1 additions and 0 deletions
|
|
@ -262,6 +262,7 @@ FILE *open_img_file(char *path, bool write, size_t *size, bool expect_present)
|
|||
if (ret) {
|
||||
pr_err("%s:Failed to access file size\n", path);
|
||||
fclose(fp);
|
||||
errno = EIO;
|
||||
return NULL;
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue