Skip to content

Commit

Permalink
dump-guest-memory: Check for the correct return value
Browse files Browse the repository at this point in the history
We should check for error with s->note_size

Signed-off-by: Aneesh Kumar K.V <[email protected]>
Signed-off-by: Alexander Graf <[email protected]>
  • Loading branch information
kvaneesh authored and agraf committed Oct 25, 2013
1 parent d83af16 commit bb6b684
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions dump.c
Original file line number Diff line number Diff line change
Expand Up @@ -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;

Expand Down Expand Up @@ -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;
}
Expand Down

0 comments on commit bb6b684

Please sign in to comment.