diff mbox

[2/3] hw/core: fix missing return value in load_image_targphys_as()

Message ID 20170623164557.11636-3-f4bug@amsat.org
State Accepted, archived
Headers show

Commit Message

Philippe Mathieu-Daudé June 23, 2017, 4:45 p.m. UTC
Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>
---
 hw/core/loader.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

Comments

Alistair Francis June 26, 2017, 10:36 p.m. UTC | #1
On Fri, Jun 23, 2017 at 9:45 AM, Philippe Mathieu-Daudé <f4bug@amsat.org> wrote:
> Signed-off-by: Philippe Mathieu-Daudé <f4bug@amsat.org>

Reviewed-by: Alistair Francis <alistair.francis@xilinx.com>

Thanks,
Alistair

> ---
>  hw/core/loader.c | 4 +++-
>  1 file changed, 3 insertions(+), 1 deletion(-)
>
> diff --git a/hw/core/loader.c b/hw/core/loader.c
> index 094f24627f..e137e772ae 100644
> --- a/hw/core/loader.c
> +++ b/hw/core/loader.c
> @@ -150,7 +150,9 @@ int load_image_targphys_as(const char *filename,
>          return -1;
>      }
>      if (size > 0) {
> -        rom_add_file_fixed_as(filename, addr, -1, as);
> +        if (rom_add_file_fixed_as(filename, addr, -1, as) < 0) {
> +            return -1;
> +        }
>      }
>      return size;
>  }
> --
> 2.13.1
>
>
Michael Tokarev June 27, 2017, 1:30 p.m. UTC | #2
Applied to -trivial, thanks!

/mjt
diff mbox

Patch

diff --git a/hw/core/loader.c b/hw/core/loader.c
index 094f24627f..e137e772ae 100644
--- a/hw/core/loader.c
+++ b/hw/core/loader.c
@@ -150,7 +150,9 @@  int load_image_targphys_as(const char *filename,
         return -1;
     }
     if (size > 0) {
-        rom_add_file_fixed_as(filename, addr, -1, as);
+        if (rom_add_file_fixed_as(filename, addr, -1, as) < 0) {
+            return -1;
+        }
     }
     return size;
 }