From: Eduardo Habkost <ehabkost@redhat.com>
To: "Daniel P. Berrangé" <berrange@redhat.com>
Cc: qemu-devel@nongnu.org, "Michael S. Tsirkin" <mst@redhat.com>,
Markus Armbruster <armbru@redhat.com>,
Paolo Bonzini <pbonzini@redhat.com>,
Richard Henderson <rth@twiddle.net>
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 [thread overview]
Message-ID: <20180716212804.GS914@localhost.localdomain> (raw)
In-Reply-To: <20180514171913.17664-3-berrange@redhat.com>
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é <berrange@redhat.com>
[...]
> @@ -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 <ehabkost@redhat.com>
Queueing on x86-next.
--
Eduardo
next prev parent reply other threads:[~2018-07-16 21:28 UTC|newest]
Thread overview: 17+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-05-14 17:19 [Qemu-devel] [PATCH 0/3] i386: fix handling of multiboot modules Daniel P. Berrangé
2018-05-14 17:19 ` [Qemu-devel] [PATCH 1/3] i386: fix regression parsing multiboot initrd modules Daniel P. Berrangé
2018-05-18 17:54 ` Peter Maydell
2018-05-21 8:56 ` Daniel P. Berrangé
2018-07-16 21:23 ` Eduardo Habkost
2018-05-14 17:19 ` [Qemu-devel] [PATCH 2/3] i386: only parse the initrd_filename once for multiboot modules Daniel P. Berrangé
2018-07-16 21:28 ` Eduardo Habkost [this message]
2018-05-14 17:19 ` [Qemu-devel] [PATCH 3/3] opts: remove redundant check for NULL parameter Daniel P. Berrangé
2018-07-16 21:28 ` Eduardo Habkost
2018-06-07 9:47 ` [Qemu-devel] [PATCH 0/3] i386: fix handling of multiboot modules Daniel P. Berrangé
2018-07-10 17:11 ` Roman Kagan
2018-07-10 17:23 ` Eduardo Habkost
2018-08-16 14:34 ` Roman Kagan
2018-08-16 14:38 ` Daniel P. Berrangé
2018-08-16 14:41 ` Roman Kagan
2018-06-20 14:57 ` Roman Kagan
2018-06-20 15:34 ` Michael S. Tsirkin
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180716212804.GS914@localhost.localdomain \
--to=ehabkost@redhat.com \
--cc=armbru@redhat.com \
--cc=berrange@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=rth@twiddle.net \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).