diff options
author | Peter Maydell <peter.maydell@linaro.org> | 2017-08-04 13:46:22 +0100 |
---|---|---|
committer | Peter Maydell <peter.maydell@linaro.org> | 2017-08-04 13:46:22 +0100 |
commit | ac44ed2afb7c60255e989b163301479f5b4ecd04 (patch) | |
tree | d68780f5b0656175368f4fe76be70fbb5687183b /hw | |
parent | c233a35d3d91af666aa95a6a3ba8244d4ce728c6 (diff) | |
parent | be2960baae07e5257cde8c814cbd91647e235147 (diff) |
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>
Diffstat (limited to 'hw')
-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; } |