qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
From: "Philippe Mathieu-Daudé" <philmd@redhat.com>
To: Peter Maydell <peter.maydell@linaro.org>, qemu-devel@nongnu.org
Cc: Michael Walle <michael@walle.cc>, patches@linaro.org
Subject: Re: [Qemu-devel] [PATCH for-3.1] milkymist: Check for failure trying to load BIOS image
Date: Tue, 30 Oct 2018 18:03:01 +0100	[thread overview]
Message-ID: <ab3dc53d-9711-55f3-36ac-595f2c4cb86a@redhat.com> (raw)
In-Reply-To: <20181030170032.1844-1-peter.maydell@linaro.org>

On 30/10/18 18:00, Peter Maydell wrote:
> Check the return value from load_image_targphys(), which tells us
> whether our attempt to load the BIOS image into RAM failed.
> (Spotted by Coverity, CID 1190305.)
> 
> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>

Reviewed-by: Philippe Mathieu-Daudé <philmd@redhat.com>

> ---
>   hw/lm32/milkymist.c | 5 ++++-
>   1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/hw/lm32/milkymist.c b/hw/lm32/milkymist.c
> index 321f184595e..63c6894c955 100644
> --- a/hw/lm32/milkymist.c
> +++ b/hw/lm32/milkymist.c
> @@ -138,7 +138,10 @@ milkymist_init(MachineState *machine)
>       bios_filename = qemu_find_file(QEMU_FILE_TYPE_BIOS, bios_name);
>   
>       if (bios_filename) {
> -        load_image_targphys(bios_filename, BIOS_OFFSET, BIOS_SIZE);
> +        if (load_image_targphys(bios_filename, BIOS_OFFSET, BIOS_SIZE) < 0) {
> +            error_report("could not load bios '%s'", bios_filename);
> +            exit(1);
> +        }
>       }
>   
>       reset_info->bootstrap_pc = BIOS_OFFSET;
> 

  reply	other threads:[~2018-10-30 17:03 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-10-30 17:00 [Qemu-devel] [PATCH for-3.1] milkymist: Check for failure trying to load BIOS image Peter Maydell
2018-10-30 17:03 ` Philippe Mathieu-Daudé [this message]
2018-10-31  8:20 ` Michael Walle
2018-11-05 14:48   ` Peter Maydell

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=ab3dc53d-9711-55f3-36ac-595f2c4cb86a@redhat.com \
    --to=philmd@redhat.com \
    --cc=michael@walle.cc \
    --cc=patches@linaro.org \
    --cc=peter.maydell@linaro.org \
    --cc=qemu-devel@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).