From: "Edgar E. Iglesias" <edgar.iglesias@gmail.com>
To: Gonglei <arei.gonglei@huawei.com>
Cc: qemu-trivial@nongnu.org, Peter Maydell <peter.maydell@linaro.org>,
Michael Tokarev <mjt@tls.msk.ru>,
qemu-devel@nongnu.org,
"pbonzini@redhat.com" <pbonzini@redhat.com>
Subject: Re: [Qemu-devel] [PATCH v2] microblaze: fix memory leak
Date: Sat, 28 Mar 2015 17:31:32 +1000 [thread overview]
Message-ID: <CAJy5ezrFVPCC1VCbvVVYYTEgx2v__AicWFUme_yh2ikuB0wOEg@mail.gmail.com> (raw)
In-Reply-To: <55161404.4000404@huawei.com>
[-- Attachment #1: Type: text/plain, Size: 2634 bytes --]
On 28/03/2015 12:38 pm, "Gonglei" <arei.gonglei@huawei.com> wrote:
>
> Hi,
>
> Ping again... Can this patch be a raw stuff for rc2 ?
Looks good to me, thanks.
Reviewed-by: Edgar E. Iglesias <edgar.iglesias@xilinx.com>
Can this go through -trivial?
Cheers,
Edgar
>
> Regards,
> Gonglei
>
> On 2015/3/17 15:15, Gonglei wrote:
> > On 2015/3/5 11:05, arei.gonglei@huawei.com wrote:
> >> From: Gonglei <arei.gonglei@huawei.com>
> >>
> >> When not assign a -dtb argument, the variable dtb_filename
> >> storage returned from qemu_find_file(), which should be freed
> >> after use. Alternatively we define a local variable filename,
> >> with 'char *' type, free after use.
> >>
> >> Cc: Michael Tokarev <mjt@tls.msk.ru>
> >> Cc: Edgar E. Iglesias <edgar.iglesias@gmail.com>
> >> Signed-off-by: Gonglei <arei.gonglei@huawei.com>
> >> ---
> >> v2: fix a complier error.
> >> ---
> >> hw/microblaze/boot.c | 13 +++++++------
> >> 1 file changed, 7 insertions(+), 6 deletions(-)
> >>
> >
> > Ping...
> >
> >> diff --git a/hw/microblaze/boot.c b/hw/microblaze/boot.c
> >> index a2843cd..352ccb1 100644
> >> --- a/hw/microblaze/boot.c
> >> +++ b/hw/microblaze/boot.c
> >> @@ -113,15 +113,15 @@ void microblaze_load_kernel(MicroBlazeCPU *cpu,
hwaddr ddr_base,
> >> const char *kernel_filename;
> >> const char *kernel_cmdline;
> >> const char *dtb_arg;
> >> + char *filename = NULL;
> >>
> >> machine_opts = qemu_get_machine_opts();
> >> kernel_filename = qemu_opt_get(machine_opts, "kernel");
> >> kernel_cmdline = qemu_opt_get(machine_opts, "append");
> >> dtb_arg = qemu_opt_get(machine_opts, "dtb");
> >> - if (dtb_arg) { /* Preference a -dtb argument */
> >> - dtb_filename = dtb_arg;
> >> - } else { /* default to pcbios dtb as passed by machine_init */
> >> - dtb_filename = qemu_find_file(QEMU_FILE_TYPE_BIOS,
dtb_filename);
> >> + /* default to pcbios dtb as passed by machine_init */
> >> + if (!dtb_arg) {
> >> + filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, dtb_filename);
> >> }
> >>
> >> boot_info.machine_cpu_reset = machine_cpu_reset;
> >> @@ -203,7 +203,8 @@ void microblaze_load_kernel(MicroBlazeCPU *cpu,
hwaddr ddr_base,
> >> boot_info.initrd_start,
> >> boot_info.initrd_end,
> >> kernel_cmdline,
> >> - dtb_filename);
> >> + /* Preference a -dtb argument */
> >> + dtb_arg ? dtb_arg : filename);
> >> }
> >> -
> >> + g_free(filename);
> >> }
> >>
> >
>
>
[-- Attachment #2: Type: text/html, Size: 4154 bytes --]
next prev parent reply other threads:[~2015-03-28 7:31 UTC|newest]
Thread overview: 10+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-03-05 3:05 [Qemu-devel] [PATCH v2] microblaze: fix memory leak arei.gonglei
2015-03-17 7:15 ` Gonglei
2015-03-28 2:37 ` Gonglei
2015-03-28 7:31 ` Edgar E. Iglesias [this message]
2015-03-28 7:46 ` Gonglei
2015-03-29 17:09 ` Michael Tokarev
2015-04-28 9:27 ` Gonglei
2015-03-28 2:55 ` Max Filippov
2015-04-29 17:10 ` Peter Crosthwaite
2015-04-29 17:17 ` Michael Tokarev
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=CAJy5ezrFVPCC1VCbvVVYYTEgx2v__AicWFUme_yh2ikuB0wOEg@mail.gmail.com \
--to=edgar.iglesias@gmail.com \
--cc=arei.gonglei@huawei.com \
--cc=mjt@tls.msk.ru \
--cc=pbonzini@redhat.com \
--cc=peter.maydell@linaro.org \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.org \
/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).