From: Michael Tokarev <mjt@tls.msk.ru>
To: qemu-devel@nongnu.org
Cc: qemu-trivial@nongnu.org, Shannon Zhao <shannon.zhao@linaro.org>,
Shannon Zhao <zhaoshenglong@huawei.com>
Subject: Re: [Qemu-trivial] [PATCH 1/2] hw/display/cg3.c: cg3_realizefn: fix memory leak, make FCode loading error fatal and improve error message
Date: Tue, 02 Jun 2015 08:53:51 +0300 [thread overview]
Message-ID: <556D44EF.1030704@msgid.tls.msk.ru> (raw)
In-Reply-To: <1432993766-5528-1-git-send-email-mjt@msgid.tls.msk.ru>
Shannon Zhao: can you please add your s-o-b or r-o-b for this
version, for this and the next patch?
This started from your original patch which just adds g_free(),
later you also added error message improvements to this piece,
on my request, but apparently this place needs more tweeking,
since failing to load firmware is fatal to the code, so instead
of requesting you to change it further I created my version,
identical for two files.
Thanks,
/mjt
30.05.2015 16:49, Michael Tokarev wrote:
> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
> ---
> hw/display/cg3.c | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/hw/display/cg3.c b/hw/display/cg3.c
> index 1e6ff2b..5f869a7 100644
> --- a/hw/display/cg3.c
> +++ b/hw/display/cg3.c
> @@ -302,10 +302,12 @@ static void cg3_realizefn(DeviceState *dev, Error **errp)
> if (fcode_filename) {
> ret = load_image_targphys(fcode_filename, s->prom_addr,
> FCODE_MAX_ROM_SIZE);
> - if (ret < 0 || ret > FCODE_MAX_ROM_SIZE) {
> - error_report("cg3: could not load prom '%s'", CG3_ROM_FILE);
> - }
> }
> + if (!fcode_filename || ret < 0 || ret > FCODE_MAX_ROM_SIZE) {
> + error_report("cg3: could not load prom '%s'",
> + fcode_filename ? fcode_filename : CG3_ROM_FILE);
> + }
> + g_free(fcode_filename);
>
> memory_region_init_ram(&s->vram_mem, NULL, "cg3.vram", s->vram_size,
> &error_abort);
>
WARNING: multiple messages have this Message-ID (diff)
From: Michael Tokarev <mjt@tls.msk.ru>
To: qemu-devel@nongnu.org
Cc: qemu-trivial@nongnu.org, Shannon Zhao <shannon.zhao@linaro.org>,
Shannon Zhao <zhaoshenglong@huawei.com>
Subject: Re: [Qemu-devel] [PATCH 1/2] hw/display/cg3.c: cg3_realizefn: fix memory leak, make FCode loading error fatal and improve error message
Date: Tue, 02 Jun 2015 08:53:51 +0300 [thread overview]
Message-ID: <556D44EF.1030704@msgid.tls.msk.ru> (raw)
In-Reply-To: <1432993766-5528-1-git-send-email-mjt@msgid.tls.msk.ru>
Shannon Zhao: can you please add your s-o-b or r-o-b for this
version, for this and the next patch?
This started from your original patch which just adds g_free(),
later you also added error message improvements to this piece,
on my request, but apparently this place needs more tweeking,
since failing to load firmware is fatal to the code, so instead
of requesting you to change it further I created my version,
identical for two files.
Thanks,
/mjt
30.05.2015 16:49, Michael Tokarev wrote:
> Signed-off-by: Michael Tokarev <mjt@tls.msk.ru>
> ---
> hw/display/cg3.c | 8 +++++---
> 1 file changed, 5 insertions(+), 3 deletions(-)
>
> diff --git a/hw/display/cg3.c b/hw/display/cg3.c
> index 1e6ff2b..5f869a7 100644
> --- a/hw/display/cg3.c
> +++ b/hw/display/cg3.c
> @@ -302,10 +302,12 @@ static void cg3_realizefn(DeviceState *dev, Error **errp)
> if (fcode_filename) {
> ret = load_image_targphys(fcode_filename, s->prom_addr,
> FCODE_MAX_ROM_SIZE);
> - if (ret < 0 || ret > FCODE_MAX_ROM_SIZE) {
> - error_report("cg3: could not load prom '%s'", CG3_ROM_FILE);
> - }
> }
> + if (!fcode_filename || ret < 0 || ret > FCODE_MAX_ROM_SIZE) {
> + error_report("cg3: could not load prom '%s'",
> + fcode_filename ? fcode_filename : CG3_ROM_FILE);
> + }
> + g_free(fcode_filename);
>
> memory_region_init_ram(&s->vram_mem, NULL, "cg3.vram", s->vram_size,
> &error_abort);
>
next prev parent reply other threads:[~2015-06-02 5:54 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-05-30 13:49 [Qemu-trivial] [PATCH 1/2] hw/display/cg3.c: cg3_realizefn: fix memory leak, make FCode loading error fatal and improve error message Michael Tokarev
2015-05-30 13:49 ` [Qemu-devel] " Michael Tokarev
2015-06-02 5:53 ` Michael Tokarev [this message]
2015-06-02 5:53 ` Michael Tokarev
2015-06-02 6:20 ` [Qemu-trivial] " Shannon Zhao
2015-06-02 6:20 ` [Qemu-devel] " Shannon Zhao
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=556D44EF.1030704@msgid.tls.msk.ru \
--to=mjt@tls.msk.ru \
--cc=qemu-devel@nongnu.org \
--cc=qemu-trivial@nongnu.org \
--cc=shannon.zhao@linaro.org \
--cc=zhaoshenglong@huawei.com \
/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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.