qemu-devel
[Top][All Lists]
Advanced

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

Re: [Qemu-devel] [PATCH 2/3] i386: only parse the initrd_filename once f


From: Eduardo Habkost
Subject: Re: [Qemu-devel] [PATCH 2/3] i386: only parse the initrd_filename once for multiboot modules
Date: Mon, 16 Jul 2018 18:28:04 -0300
User-agent: Mutt/1.9.2 (2017-12-15)

On Mon, May 14, 2018 at 06:19:12PM +0100, Daniel P. Berrangé wrote:
> The multiboot code parses the initrd_filename twice, first to count how
> many entries there are, and second to process each entry. This changes
> the first loop to store the parse module names in a list, and the second
> loop can now use these names. This avoids having to pass NULL to the
> get_opt_value() method which means it can safely assume a non-NULL param.
> 
> Signed-off-by: Daniel P. Berrangé <address@hidden>
[...]
> @@ -352,10 +350,10 @@ int load_multiboot(FWCfgState *fw_cfg,
>              mb_debug("mod_start: %p\nmod_end:   %p\n  cmdline: 
> "TARGET_FMT_plx,
>                       (char *)mbs.mb_buf + offs,
>                       (char *)mbs.mb_buf + offs + mb_mod_length, c);
> -            initrd_filename = next_initrd+1;
>              g_free(one_file);
> -            one_file = NULL;
> -        } while (not_last);
> +            tmpl = tmpl->next;
> +        }
> +        g_list_free(mods);

I thought this would cause double free of tmpl->data, but
g_list_free() won't free the elements' data.

Reviewed-by: Eduardo Habkost <address@hidden>

Queueing on x86-next.

-- 
Eduardo



reply via email to

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