milkymist: Check for failure trying to load BIOS image
PATCH 1/1 milkymist: Check for failure trying to load BIOS image
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.)
--- hw/lm32/milkymist.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)
hw/lm32/milkymist.c +4 -1
@@ -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 ;
Signature · 1 line
2.19.1
Quoted 5 lines · 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 <[email protected]>
Quoted 21 lines
--- hw/lm32/milkymist.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)hw/lm32/milkymist.c +4
-1@@ -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 ;
Am 2018-10-30 18:00, schrieb Peter Maydell:
Quoted 5 lines
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 <[email protected]>
Will you put it in your queue, Peter?
-michael
Quoted 21 lines
--- hw/lm32/milkymist.c | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-)hw/lm32/milkymist.c +4
-1@@ -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;
Quoted 6 lines · Michael Walle
Am 2018-10-30 18:00, schrieb Peter Maydell:
Quoted 5 lines
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.)
Quoted 6 lines
Quoted 1 line
Signed-off-by Peter Maydell <[email protected]>Acked-by Michael Walle <[email protected]>Will you put it in your queue, Peter?
Sure, I have an arm pullreq I'm putting together anyway.
thanks
-- PMM