Skip to content

Commit

Permalink
linux-user: Check for cpu_init() errors
Browse files Browse the repository at this point in the history
This was the only caller of cpu_init() that was not checking for NULL
yet.

Reviewed-by: Paolo Bonzini <pbonzini@redhat.com>
Signed-off-by: Eduardo Habkost <ehabkost@redhat.com>
(cherry picked from commit 696da41)

Conflicts:
	linux-user/main.c

*removed context dependency on ec53b45

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
  • Loading branch information
ehabkost authored and mdroth committed Mar 9, 2015
1 parent 4ec1b9b commit a958b9b
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion linux-user/main.c
Expand Up @@ -3435,12 +3435,19 @@ CPUArchState *cpu_copy(CPUArchState *env)
{
CPUState *cpu = ENV_GET_CPU(env);
CPUArchState *new_env = cpu_init(cpu_model);
CPUState *new_cpu = ENV_GET_CPU(new_env);
CPUState *new_cpu;
#if defined(TARGET_HAS_ICE)
CPUBreakpoint *bp;
CPUWatchpoint *wp;
#endif

if (!new_env) {
fprintf(stderr, "cpu_copy: Failed to create new CPU\n");
exit(1);
}

new_cpu = ENV_GET_CPU(new_env);

/* Reset non arch specific state */
cpu_reset(new_cpu);

Expand Down

0 comments on commit a958b9b

Please sign in to comment.