amdgpu: print an error if the dup syscall fails

Signed-off-by: Andrei Vagin <avagin@gmail.com>
This commit is contained in:
Andrei Vagin 2023-09-28 21:49:39 -07:00
parent 940a05c0ba
commit aa38a59899

View file

@ -1796,7 +1796,12 @@ int amdgpu_plugin_restore_file(int id)
* copy of the fd. CRIU core owns the duplicated returned fd, and amdgpu_plugin owns the fd stored in
* tp_node.
*/
return dup(fd);
fd = dup(fd);
if (fd == -1) {
pr_perror("unable to duplicate the render fd");
return -1;
}
return fd;
}
fd = open(AMDGPU_KFD_DEVICE, O_RDWR | O_CLOEXEC);