Commit 534a96ab74 for qemu.org
commit 534a96ab74a91ddcab0f40eff536a17282d3f674
Author: Peter Maydell <peter.maydell@linaro.org>
Date: Thu Feb 26 11:27:19 2026 +0000
target/arm/kvm: Don't free migration-blocker reason on failure
The migrate_add_blocker() function documents that if it fails it will
free the Error it is passed via its reasonp argument and set reasonp
to NULL. That means that in kvm_arm_enable_mte() we don't need to
call error_free(mte_migration_blocker) in the failure codepath.
Doing so is harmless because error_free(NULL) is permitted and does
nothing, but we can remove the unnecessary code.
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
Reviewed-by: Pierrick Bouvier <pierrick.bouvier@linaro.org>
Message-id: 20260223173232.453165-1-peter.maydell@linaro.org
diff --git a/target/arm/kvm.c b/target/arm/kvm.c
index 4908138764..eaa065d726 100644
--- a/target/arm/kvm.c
+++ b/target/arm/kvm.c
@@ -2554,7 +2554,6 @@ void kvm_arm_enable_mte(Object *cpuobj, Error **errp)
error_setg(&mte_migration_blocker,
"Live migration disabled due to MTE enabled");
if (migrate_add_blocker(&mte_migration_blocker, errp)) {
- error_free(mte_migration_blocker);
return;
}