Skip to contentSkip to conversation

dump-guest-memory: Check for the correct return value

PATCH New Aneesh Kumar K.V 1 participant 1 message Sep 4, 2013

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 dump-guest-memory: Check for the correct return value

From: "Aneesh Kumar K.V" <[email protected]>

We should check for error with s->note_size

---
 dump.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
dump.c +2 -2
index c0dae2c..80dd9d6 100644
@@ -66,7 +66,7 @@ typedef struct DumpState {
     uint32_t sh_info;
     bool have_section;
     bool resume;
-    size_t note_size;
+    ssize_t note_size;
     hwaddr memory_offset;
     int fd;
 
@@ -765,7 +765,7 @@ static int dump_init(DumpState *s, int fd, bool paging, bool has_filter,
 
     s->note_size = cpu_get_note_size(s->dump_info.d_class,
                                      s->dump_info.d_machine, nr_cpus);
-    if (ret < 0) {
+    if (s->note_size < 0) {
         error_set(errp, QERR_UNSUPPORTED);
         goto cleanup;
     }
Signature · 1 line
1.8.1.2