* [Qemu-devel] [PATCH for-3.1] milkymist: Check for failure trying to load BIOS image
@ 2018-10-30 17:00 Peter Maydell
2018-10-30 17:03 ` Philippe Mathieu-Daudé
2018-10-31 8:20 ` Michael Walle
0 siblings, 2 replies; 4+ messages in thread
From: Peter Maydell @ 2018-10-30 17:00 UTC (permalink / raw)
To: qemu-devel; +Cc: patches, Michael Walle
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>
---
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;
--
2.19.1
^ permalink raw reply related [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH for-3.1] milkymist: Check for failure trying to load BIOS image
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é
2018-10-31 8:20 ` Michael Walle
1 sibling, 0 replies; 4+ messages in thread
From: Philippe Mathieu-Daudé @ 2018-10-30 17:03 UTC (permalink / raw)
To: Peter Maydell, qemu-devel; +Cc: Michael Walle, patches
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;
>
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH for-3.1] milkymist: Check for failure trying to load BIOS image
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é
@ 2018-10-31 8:20 ` Michael Walle
2018-11-05 14:48 ` Peter Maydell
1 sibling, 1 reply; 4+ messages in thread
From: Michael Walle @ 2018-10-31 8:20 UTC (permalink / raw)
To: Peter Maydell; +Cc: qemu-devel, patches
Am 2018-10-30 18:00, schrieb Peter Maydell:
> 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>
Acked-by: Michael Walle <michael@walle.cc>
Will you put it in your queue, Peter?
-michael
> ---
> 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;
^ permalink raw reply [flat|nested] 4+ messages in thread
* Re: [Qemu-devel] [PATCH for-3.1] milkymist: Check for failure trying to load BIOS image
2018-10-31 8:20 ` Michael Walle
@ 2018-11-05 14:48 ` Peter Maydell
0 siblings, 0 replies; 4+ messages in thread
From: Peter Maydell @ 2018-11-05 14:48 UTC (permalink / raw)
To: Michael Walle; +Cc: QEMU Developers, patches@linaro.org
On 31 October 2018 at 08:20, Michael Walle <michael@walle.cc> wrote:
> Am 2018-10-30 18:00, schrieb Peter Maydell:
>>
>> 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>
>
>
> Acked-by: Michael Walle <michael@walle.cc>
>
> Will you put it in your queue, Peter?
Sure, I have an arm pullreq I'm putting together anyway.
thanks
-- PMM
^ permalink raw reply [flat|nested] 4+ messages in thread
end of thread, other threads:[~2018-11-05 14:49 UTC | newest]
Thread overview: 4+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
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é
2018-10-31 8:20 ` Michael Walle
2018-11-05 14:48 ` Peter Maydell
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).