]> git.ipfire.org Git - thirdparty/qemu.git/commitdiff
target/arm/hvf: Release memory allocated by hv_vcpu_config_create()
authorPhilippe Mathieu-Daudé <philmd@linaro.org>
Tue, 28 Oct 2025 05:41:37 +0000 (06:41 +0100)
committerPeter Maydell <peter.maydell@linaro.org>
Fri, 31 Oct 2025 16:26:45 +0000 (16:26 +0000)
hv_vcpu_config_create() is documented in <Hypervisor/hv_vcpu_config.h>
as:

  /*!
   @abstract Creates a vcpu configuration object.
   @result A new vcpu configuration object. This should be released with os_release when no longer used.
   */
  OS_OBJECT_RETURNS_RETAINED OS_WARN_RESULT
  hv_vcpu_config_t hv_vcpu_config_create(void);

Release the memory allocated by hv_vcpu_config_create() with
os_release().

Signed-off-by: Philippe Mathieu-Daudé <philmd@linaro.org>
Reviewed-by: Richard Henderson <richard.henderson@linaro.org>
Reviewed-by: Mads Ynddal <mads@ynddal.dk>
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
target/arm/hvf/hvf.c

index 0658a99a2d1fc4880bc77e0dfaf20f3f97b598eb..83db1088384a9e9a2eef00ae70b48b584dc51db0 100644 (file)
@@ -150,6 +150,8 @@ void hvf_arm_init_debug(void)
     max_hw_wps = hvf_arm_num_wrps(config);
     hw_watchpoints =
         g_array_sized_new(true, true, sizeof(HWWatchpoint), max_hw_wps);
+
+    os_release(config);
 }
 
 #define SYSREG_OP0_SHIFT      20