Skip to content

Commit

Permalink
amdgpu: print an error if the dup syscall fails
Browse files Browse the repository at this point in the history
Signed-off-by: Andrei Vagin <[email protected]>
  • Loading branch information
avagin committed Oct 2, 2023
1 parent 506a944 commit cd3b4de
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion plugins/amdgpu/amdgpu_plugin.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit cd3b4de

Please sign in to comment.