mirror of
https://github.com/checkpoint-restore/criu.git
synced 2026-07-18 00:58:31 +00:00
plugin/amdgpu: fix memory leak in dmabuf restore error paths
Free the protobuf message and buffer when returning early from amdgpu_plugin_dmabuf_restore() on failure to find a dmabuf fd. Signed-off-by: Radostin Stoyanov <rstoyanov@fedoraproject.org>
This commit is contained in:
parent
16b252ee21
commit
b8d118a758
1 changed files with 4 additions and 0 deletions
|
|
@ -139,12 +139,16 @@ int amdgpu_plugin_dmabuf_restore(int id)
|
|||
fd_id = amdgpu_id_for_handle(rd->gem_handle);
|
||||
if (fd_id == -1) {
|
||||
pr_err("Failed to find dmabuf_fd for GEM handle = %d\n", rd->gem_handle);
|
||||
criu_dmabuf_node__free_unpacked(rd, NULL);
|
||||
xfree(buf);
|
||||
return 1;
|
||||
}
|
||||
|
||||
int dmabuf_fd = fdstore_get(fd_id);
|
||||
if (dmabuf_fd == -1) {
|
||||
pr_err("Failed to find dmabuf_fd for GEM handle = %d\n", rd->gem_handle);
|
||||
criu_dmabuf_node__free_unpacked(rd, NULL);
|
||||
xfree(buf);
|
||||
return 1; /* Retry needed */
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue