Arun Menon <arme...@redhat.com> writes: > 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. > > Signed-off-by: Arun Menon <arme...@redhat.com>
Reviewed-by: Fabiano Rosas <faro...@suse.de>