From: Fabien Chouteau Date: Wed, 25 Feb 2015 09:50:28 +0000 (+0100) Subject: Openpic: check that cpu id is within the number of cpus X-Git-Tag: TizenStudio_2.0_p2.3.2~208^2~319^2~19 X-Git-Url: http://review.tizen.org/git/?a=commitdiff_plain;h=04d2acbb57900f1cba2eef86b21ab78d854683db;p=sdk%2Femulator%2Fqemu.git Openpic: check that cpu id is within the number of cpus Signed-off-by: Fabien Chouteau Signed-off-by: Alexander Graf --- diff --git a/hw/intc/openpic.c b/hw/intc/openpic.c index 7d1f3b9..305377d 100644 --- a/hw/intc/openpic.c +++ b/hw/intc/openpic.c @@ -1013,7 +1013,7 @@ static void openpic_cpu_write_internal(void *opaque, hwaddr addr, DPRINTF("%s: cpu %d addr %#" HWADDR_PRIx " <= 0x%08x\n", __func__, idx, addr, val); - if (idx < 0) { + if (idx < 0 || idx >= opp->nb_cpus) { return; } @@ -1152,7 +1152,7 @@ static uint32_t openpic_cpu_read_internal(void *opaque, hwaddr addr, DPRINTF("%s: cpu %d addr %#" HWADDR_PRIx "\n", __func__, idx, addr); retval = 0xFFFFFFFF; - if (idx < 0) { + if (idx < 0 || idx >= opp->nb_cpus) { return retval; }