mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-23 01:59:04 +00:00
The exit label in amdgpu_plugin_drm_restore_file() returns immediately when ret < 0 without freeing the dmabufs array or deinitializing the amdgpu device handle. Move cleanup before the error check so resources are always released. Replace xzalloc() with xmalloc() and memset(0xff) for the dmabufs array because zero is a valid fd number and would cause the cleanup loop to close fd 0 (stdin) for unpopulated entries. Initializing to KFD_INVALID_FD (0xffffffff) lets the exit block tell which fds were actually opened. Guard amdgpu_device_deinitialize() behind a dev_initialized flag to avoid calling it when initialization failed, and close dmabuf_fd when drmPrimeFDToHandle() fails. To prevent double-closing fds that restore_bo_contents_drm() already closed, only run the close loop when the BO content restore was not reached. Signed-off-by: Radostin Stoyanov <rstoyanov@fedoraproject.org> |
||
|---|---|---|
| .. | ||
| amdgpu | ||
| cuda | ||