diff options
Diffstat (limited to 'monitor/misc.c')
-rw-r--r-- | monitor/misc.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/monitor/misc.c b/monitor/misc.c index 6680734ea1..a04d7edde0 100644 --- a/monitor/misc.c +++ b/monitor/misc.c @@ -391,7 +391,7 @@ int monitor_set_cpu(int cpu_index) /* Callers must hold BQL. */ static CPUState *mon_get_cpu_sync(bool synchronize) { - CPUState *cpu; + CPUState *cpu = NULL; if (cur_mon->mon_cpu_path) { cpu = (CPUState *) object_resolve_path_type(cur_mon->mon_cpu_path, @@ -408,6 +408,7 @@ static CPUState *mon_get_cpu_sync(bool synchronize) monitor_set_cpu(first_cpu->cpu_index); cpu = first_cpu; } + assert(cpu != NULL); if (synchronize) { cpu_synchronize_state(cpu); } |