diff options
author | Peter Maydell | 2017-08-04 14:46:22 +0200 |
---|---|---|
committer | Peter Maydell | 2017-08-04 14:46:22 +0200 |
commit | ac44ed2afb7c60255e989b163301479f5b4ecd04 (patch) | |
tree | d68780f5b0656175368f4fe76be70fbb5687183b | |
parent | Merge remote-tracking branch 'remotes/yongbok/tags/mips-20170803' into staging (diff) | |
parent | cpu: don't allow negative core id (diff) | |
download | qemu-ac44ed2afb7c60255e989b163301479f5b4ecd04.tar.gz qemu-ac44ed2afb7c60255e989b163301479f5b4ecd04.tar.xz qemu-ac44ed2afb7c60255e989b163301479f5b4ecd04.zip |
Merge remote-tracking branch 'remotes/ehabkost/tags/machine-pull-request' into staging
cpu: crash fix (don't allow negative core id)
# gpg: Signature made Thu 03 Aug 2017 18:57:41 BST
# gpg: using RSA key 0x2807936F984DC5A6
# gpg: Good signature from "Eduardo Habkost <ehabkost@redhat.com>"
# Primary key fingerprint: 5A32 2FD5 ABC4 D3DB ACCF D1AA 2807 936F 984D C5A6
* remotes/ehabkost/tags/machine-pull-request:
cpu: don't allow negative core id
Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
-rw-r--r-- | hw/cpu/core.c | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/hw/cpu/core.c b/hw/cpu/core.c index 2bf960d6a8..bd578ab80c 100644 --- a/hw/cpu/core.c +++ b/hw/cpu/core.c @@ -33,6 +33,11 @@ static void core_prop_set_core_id(Object *obj, Visitor *v, const char *name, return; } + if (value < 0) { + error_setg(errp, "Invalid core id %"PRId64, value); + return; + } + core->core_id = value; } |