[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-ppc] [PATCH -V4 3/4] target-ppc: Check for error on address transl
From: |
Aneesh Kumar K.V |
Subject: |
[Qemu-ppc] [PATCH -V4 3/4] target-ppc: Check for error on address translation in memsave command |
Date: |
Thu, 5 Sep 2013 13:46:46 +0530 |
From: "Aneesh Kumar K.V" <address@hidden>
When we translate the virtual address to physical check for error.
Signed-off-by: Aneesh Kumar K.V <address@hidden>
---
cpus.c | 5 ++++-
1 file changed, 4 insertions(+), 1 deletion(-)
diff --git a/cpus.c b/cpus.c
index 0f65e76..313b216 100644
--- a/cpus.c
+++ b/cpus.c
@@ -1309,7 +1309,10 @@ void qmp_memsave(int64_t addr, int64_t size, const char
*filename,
l = sizeof(buf);
if (l > size)
l = size;
- cpu_memory_rw_debug(cpu, addr, buf, l, 0);
+ if (cpu_memory_rw_debug(cpu, addr, buf, l, 0) != 0) {
+ error_setg(errp, "Invalid addr 0x%016" PRIx64 "specified", addr);
+ goto exit;
+ }
if (fwrite(buf, 1, l, f) != l) {
error_set(errp, QERR_IO_ERROR);
goto exit;
--
1.8.1.2