qemu-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [PULL 11/20] nubus-device: add romfile property for loading declarat


From: Peter Maydell
Subject: Re: [PULL 11/20] nubus-device: add romfile property for loading declaration ROMs
Date: Sat, 2 Oct 2021 11:30:43 +0100

On Wed, 29 Sept 2021 at 10:53, Laurent Vivier <laurent@vivier.eu> wrote:
>
> From: Mark Cave-Ayland <mark.cave-ayland@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-ayland@ilande.co.uk>
> Reviewed-by: Laurent Vivier <laurent@vivier.eu>
> Message-Id: <20210924073808.1041-12-mark.cave-ayland@ilande.co.uk>
> Signed-off-by: Laurent Vivier <laurent@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



reply via email to

[Prev in Thread] Current Thread [Next in Thread]