qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: David Gibson <david@gibson.dropbear.id.au>
To: Zhou Jie <zhoujie2011@cn.fujitsu.com>
Cc: qemu-devel@nongnu.org, qemu-trivial@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] Added negative check for get_image_size()
Date: Tue, 26 Apr 2016 12:02:30 +1000	[thread overview]
Message-ID: <20160426020230.GH15176@voom.fritz.box> (raw)
In-Reply-To: <1461598566-28454-1-git-send-email-zhoujie2011@cn.fujitsu.com>

[-- Attachment #1: Type: text/plain, Size: 1204 bytes --]

On Mon, Apr 25, 2016 at 11:36:06AM -0400, Zhou Jie wrote:
> This patch adds check for negative return value from get_image_size(),
> where it is missing. It avoids unnecessary two function calls.
> 
> Signed-off-by: Zhou Jie <zhoujie2011@cn.fujitsu.com>

Applied to ppc-for-2.7, thanks.

> ---
>  hw/ppc/spapr.c | 4 ++++
>  1 file changed, 4 insertions(+)
> 
> diff --git a/hw/ppc/spapr.c b/hw/ppc/spapr.c
> index feaab08..ccea633 100644
> --- a/hw/ppc/spapr.c
> +++ b/hw/ppc/spapr.c
> @@ -1842,6 +1842,10 @@ static void ppc_spapr_init(MachineState *machine)
>          exit(1);
>      }
>      spapr->rtas_size = get_image_size(filename);
> +    if (spapr->rtas_size < 0) {
> +        error_report("Could not get size of LPAR rtas '%s'", filename);
> +        exit(1);
> +    }
>      spapr->rtas_blob = g_malloc(spapr->rtas_size);
>      if (load_image_size(filename, spapr->rtas_blob, spapr->rtas_size) < 0) {
>          error_report("Could not load LPAR rtas '%s'", filename);

-- 
David Gibson			| I'll have my music baroque, and my code
david AT gibson.dropbear.id.au	| minimalist, thank you.  NOT _the_ _other_
				| _way_ _around_!
http://www.ozlabs.org/~dgibson

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 819 bytes --]

      reply	other threads:[~2016-04-26  2:03 UTC|newest]

Thread overview: 2+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2016-04-25 15:36 [Qemu-devel] [PATCH] Added negative check for get_image_size() Zhou Jie
2016-04-26  2:02 ` David Gibson [this message]

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=20160426020230.GH15176@voom.fritz.box \
    --to=david@gibson.dropbear.id.au \
    --cc=qemu-devel@nongnu.org \
    --cc=qemu-trivial@nongnu.org \
    --cc=zhoujie2011@cn.fujitsu.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 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).