[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Qemu-devel] [PATCH 2/4] Add error checking for load_image_targphys.
From: |
Stefan Hajnoczi |
Subject: |
Re: [Qemu-devel] [PATCH 2/4] Add error checking for load_image_targphys. |
Date: |
Sun, 16 Oct 2016 17:55:51 +0100 |
User-agent: |
Mutt/1.7.0 (2016-08-17) |
On Sun, Oct 16, 2016 at 12:48:24AM -0000, Shreya Shrivastava wrote:
> Add checks for negative return value to uses of load_image_targphys.
> Signed-off-by: Shreya Shrivastava <address@hidden>
>
> ---
> hw/arm/nseries.c | 9 +++++++--
> hw/lm32/milkymist.c | 19 +++++++++++++++----
> hw/ppc/virtex_ml507.c | 5 +++++
> 3 files changed, 27 insertions(+), 6 deletions(-)
>
> diff --git a/hw/arm/nseries.c b/hw/arm/nseries.c
> index c86cf80..e0b0ae5 100644
> --- a/hw/arm/nseries.c
> +++ b/hw/arm/nseries.c
> @@ -1306,6 +1306,7 @@ static int n810_atag_setup(const struct
> arm_boot_info *info, void *p)
Your email client is wrapping lines. git-am(1) cannot apply this patch.
Please use git-send-email(1) as recommended in the guidelines:
http://qemu-project.org/Contribute/SubmitAPatch
> static void n8x0_init(MachineState *machine,
> struct arm_boot_info *binfo, int model)
> {
> + int rom_size;
> MemoryRegion *sysmem = get_system_memory();
> struct n800_s *s = (struct n800_s *) g_malloc0(sizeof(*s));
> int sdram_size = binfo->ram_size;
> @@ -1379,10 +1380,14 @@ static void n8x0_init(MachineState *machine,
> *
> * The code above is for loading the `zImage' file from Nokia
> * images. */
> - load_image_targphys(option_rom[0].name,
> + rom_size = load_image_targphys(option_rom[0].name,
> OMAP2_Q2_BASE + 0x400000,
> sdram_size - 0x400000);
> -
> + if (rom_size < 0) {
> + fprintf(stderr, "qemu: could not load rom file '%s'\n",
> + option_rom[0].name);
> + exit(1);
> + }
QEMU coding style uses 4-space indentation. Please run your patches
through scripts/checkpatch.pl to identify coding style issues.
signature.asc
Description: PGP signature