On Wed, 29 Sept 2021 at 10:53, Laurent Vivier <[email protected]> wrote:
>
> From: Mark Cave-Ayland <[email protected]>
>
> The declaration ROM is located at the top-most address of the standard slot
> space.
>
> Signed-off-by: Mark Cave-Ayland <[email protected]>
> Reviewed-by: Laurent Vivier <[email protected]>
> Message-Id: <[email protected]>
> Signed-off-by: Laurent Vivier <[email protected]>
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