]> git.ipfire.org Git - thirdparty/qemu.git/commit
target-i386: Fix X86CPU error handling
authorAndreas Färber <afaerber@suse.de>
Fri, 2 Aug 2013 16:56:05 +0000 (18:56 +0200)
committerMichael Roth <mdroth@linux.vnet.ibm.com>
Tue, 13 Aug 2013 14:30:50 +0000 (09:30 -0500)
commit405539005133bc3e7bb0c016ede3167eafac1df9
treef90a7d53e56d87283cbe01755800a228e246b22e
parentca73e42f6d9581f785ff12a441501d94a97f5532
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>
(cherry picked from commit cd7b87ffe9b6b7b0089ec8c71555f3b942bc6daf)

Signed-off-by: Michael Roth <mdroth@linux.vnet.ibm.com>
hw/i386/pc.c
target-i386/cpu.c