]> git.ipfire.org Git - thirdparty/qemu.git/commit
hw/loongarch/virt: Fix cpuslot::cpu set at last in virt_cpu_plug()
authorBibo Mao <maobibo@loongson.cn>
Mon, 24 Mar 2025 03:01:44 +0000 (11:01 +0800)
committerSong Gao <gaosong@loongson.cn>
Tue, 8 Apr 2025 06:44:26 +0000 (14:44 +0800)
commit988ad4ccebb625a47a73977bfac291341a951c6e
tree9eae9a12f19276594234b53e8403bbcb0fd26de7
parentdfaecc04c46d298e9ee81bd0ca96d8754f1c27ed
hw/loongarch/virt: Fix cpuslot::cpu set at last in virt_cpu_plug()

In function virt_cpu_plug(), Object cpuslot::cpu is set at last
only when there is no any error, otherwise it is problematic that
cpuslot::cpu is set in advance however it returns because of error.

Fixes: ab9935d2991e (hw/loongarch/virt: Implement cpu plug interface)
Signed-off-by: Bibo Mao <maobibo@loongson.cn>
Reviewed-by: Markus Armbruster <armbru@redhat.com>
Message-Id: <20250324030145.3037408-2-maobibo@loongson.cn>
Signed-off-by: Song Gao <gaosong@loongson.cn>
hw/loongarch/virt.c