On Wed, 29 Sept 2021 at 10:53, Laurent Vivier <laur...@vivier.eu> wrote: > > From: Mark Cave-Ayland <mark.cave-ayl...@ilande.co.uk> > > The declaration ROM is located at the top-most address of the standard slot > space. > > Signed-off-by: Mark Cave-Ayland <mark.cave-ayl...@ilande.co.uk> > Reviewed-by: Laurent Vivier <laur...@vivier.eu> > Message-Id: <20210924073808.1041-12-mark.cave-ayl...@ilande.co.uk> > Signed-off-by: Laurent Vivier <laur...@vivier.eu>
Coverity spots a memory leak here: CID 1464062 > + name = g_strdup_printf("nubus-slot-%x-declaration-rom", nd->slot); > + memory_region_init_rom(&nd->decl_rom, OBJECT(dev), name, size, > + &error_abort); > + ret = load_image_mr(path, &nd->decl_rom); > + g_free(path); > + if (ret < 0) { > + error_setg(errp, "could not load romfile \"%s\"", nd->romfile); > + return; > + } > + memory_region_add_subregion(&nd->slot_mem, NUBUS_SLOT_SIZE - size, > + &nd->decl_rom); 'name' is allocated, but never freed. -- PMM