summary refs log tree commit diff stats
path: root/migration/migration.c
diff options
context:
space:
mode:
authorArun Menon <armenon@redhat.com>2025-09-18 20:53:37 +0530
committerPeter Xu <peterx@redhat.com>2025-10-03 09:48:02 -0400
commitd9d7c8d81398bb45d59cbdf1b4c2ed30f56c733d (patch)
tree490cbe51326a2b67605e041d8826cc0dd9a5afe0 /migration/migration.c
parent97c2fad858b521afef1d0aad7b6bb880fbe0fb05 (diff)
downloadfocaccia-qemu-d9d7c8d81398bb45d59cbdf1b4c2ed30f56c733d.tar.gz
focaccia-qemu-d9d7c8d81398bb45d59cbdf1b4c2ed30f56c733d.zip
migration: Return -1 on memory allocation failure in ram.c
The function colo_init_ram_cache() currently returns -errno if
qemu_anon_ram_alloc() fails. However, the subsequent cleanup loop that
calls qemu_anon_ram_free() could potentially alter the value of errno.
This would cause the function to return a value that does not accurately
represent the original allocation failure.

This commit changes the return value to -1 on memory allocation failure.
This ensures that the return value is consistent and is not affected by
any errno changes that may occur during the free process.

Reviewed-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Peter Xu <peterx@redhat.com>
Signed-off-by: Arun Menon <armenon@redhat.com>
Tested-by: Fabiano Rosas <farosas@suse.de>
Reviewed-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp>
Link: https://lore.kernel.org/r/20250918-propagate_tpm_error-v14-20-36f11a6fb9d3@redhat.com
Signed-off-by: Peter Xu <peterx@redhat.com>
Diffstat (limited to 'migration/migration.c')
0 files changed, 0 insertions, 0 deletions