]> git.proxmox.com Git - mirror_qemu.git/commit - hw/i386/pc.c
target-i386: Fix X86CPU error handling
authorAndreas Färber <afaerber@suse.de>
Fri, 2 Aug 2013 16:56:05 +0000 (18:56 +0200)
committerAndreas Färber <afaerber@suse.de>
Tue, 6 Aug 2013 17:27:20 +0000 (19:27 +0200)
commitcd7b87ffe9b6b7b0089ec8c71555f3b942bc6daf
tree91311bcd9e685a0078a9d5ce0725de1ff506ba12
parenta1fc6246b3964e74ddb3a7e0b8bba03af1c6ac38
target-i386: Fix X86CPU error handling

Error **errp argument is not for emitting warnings, it means an error
has occurred and the caller should not make any assumptions about the
state of other return values (unless otherwise documented).

Therefore cpu_x86_create() must unref the new X86CPU itself, and
pc_new_cpu() must check for an Error rather than NULL return value.

While at it, clean up a superfluous NULL check.

Reported-by: Jan Kiszka <jan.kiszka@siemens.com>
Cc: qemu-stable@nongnu.org
Cc: Igor Mammedov <imammedo@redhat.com>
Signed-off-by: Andreas Färber <afaerber@suse.de>
hw/i386/pc.c
target-i386/cpu.c