|
From: | Paolo Bonzini |
Subject: | Re: [Qemu-devel] [PATCH v5 1/4] cpus: Define callback for QEMU "nmi" command |
Date: | Tue, 10 Jun 2014 13:45:27 +0200 |
User-agent: | Mozilla/5.0 (X11; Linux x86_64; rv:24.0) Gecko/20100101 Thunderbird/24.5.0 |
Il 10/06/2014 13:43, Cornelia Huck ha scritto:
> + CPUState *cs = qemu_get_cpu(monitor_get_cpu_index()); > + CPUClass *cc = CPU_GET_CLASS(cs);Just wondering: Is CPU_GET_CLASS(NULL) really safe?
No, it's not...
> + > + if (cs && cc->nmi_monitor_handler) {Or is cs == NULL simply not possible, and the code should check for cc != NULL here instead?
... and cc cannot be NULL either here. Paolo
> + cc->nmi_monitor_handler(cs, errp);
[Prev in Thread] | Current Thread | [Next in Thread] |