mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-18 00:58:31 +00:00
Several error paths in amdgpu_plugin_drm_dump_file() leak resources. The drmPrimeHandleToFD() and open_img_file() failures use break instead of goto exit, which skips per-iteration cleanup and lets the function continue dumping metadata with a stale ret value. Replace break with proper resource cleanup and goto exit. The vm_info_entries buffer is not freed when the ioctl or allocate_vm_entries() calls fail after allocating it, and the buffer from posix_memalign() is never freed after sdma_copy_bo(), leaking memory on every loop iteration. Add the missing xfree() calls. Check the amdgpu_device_initialize() return value because h_dev is undefined on failure. Move list_handles_entries cleanup into the exit block because error paths that goto exit skip the existing xfree() call after the loop. Add a NULL check before free_e(rd) because rd allocation can fail before the struct is initialized. Signed-off-by: Radostin Stoyanov <rstoyanov@fedoraproject.org> |
||
|---|---|---|
| .. | ||
| amdgpu | ||
| cuda | ||