From: Philippe Mathieu-Daudé Date: Mon, 29 Apr 2024 09:11:04 +0000 (+0200) Subject: accel/nvmm: Fix NULL dereference in nvmm_init_vcpu() X-Git-Url: http://git.maquefel.me/?a=commitdiff_plain;h=61653b4a97b1c08b0f1d090da1ed981362a3961a;p=qemu.git accel/nvmm: Fix NULL dereference in nvmm_init_vcpu() When mechanically moving the @dirty field to AccelCPUState in commit 79f1926b2d, we neglected cpu->accel is still NULL when we want to dereference it. Reported-by: Volker Rümelin Suggested-by: Volker Rümelin Fixes: 79f1926b2d ("accel/nvmm: Use accel-specific per-vcpu @dirty field") Signed-off-by: Philippe Mathieu-Daudé Reviewed-by: Richard Henderson Message-Id: <20240429091918.27429-3-philmd@linaro.org> --- diff --git a/target/i386/nvmm/nvmm-all.c b/target/i386/nvmm/nvmm-all.c index f9cced53b3..65768aca03 100644 --- a/target/i386/nvmm/nvmm-all.c +++ b/target/i386/nvmm/nvmm-all.c @@ -982,7 +982,7 @@ nvmm_init_vcpu(CPUState *cpu) } } - cpu->accel->dirty = true; + qcpu->dirty = true; cpu->accel = qcpu; return 0;