hw/cxl: fix invalid free on early return
docs/devel/style.rst: * Variables declared with g_auto* MUST always be initialized, otherwise the cleanup function will use uninitialized stack memory Fixes: 680935c9a6ff ("hw/cxl: Add a performant (and correct) path for the non interleaved cases") Reviewed-by: Akihiko Odaki <odaki@rsg.ci.i.u-tokyo.ac.jp> Reviewed-by: Philippe Mathieu-Daudé <philmd@oss.qualcomm.com> Signed-off-by: Marc-André Lureau <marcandre.lureau@redhat.com>
Marc-André Lureau committed
Jul 26, 2026 at 20:59 UTC
fdad10190af75010558bfc6d00706537b33b8346
1 file changed
+1
-1
hw/cxl/cxl-host.c
+1
-1
@@ -279,7 +279,7 @@ static void cxl_fmws_direct_passthrough_setup(CXLDirectPTState *state,
279
MemoryRegion *mr = NULL;
280
uint64_t vmr_size = 0, pmr_size = 0, offset = 0;
281
MemoryRegion *direct_mr;
282
- g_autofree char *direct_mr_name;
282
+ g_autofree char *direct_mr_name = NULL;
283
unsigned int idx = state->hdm_decoder_idx;
284
285
if (ct3d->hostvmem) {