qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] Openpic: check that cpu id is within the number of cpus
@ 2015-02-25  9:50 Fabien Chouteau
  2015-02-26 12:16 ` Alexander Graf
  0 siblings, 1 reply; 3+ messages in thread
From: Fabien Chouteau @ 2015-02-25  9:50 UTC (permalink / raw)
  To: qemu-devel, qemu-trivial; +Cc: agraf


Signed-off-by: Fabien Chouteau <chouteau@adacore.com>
---
 hw/intc/openpic.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

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;
     }
 
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] Openpic: check that cpu id is within the number of cpus
  2015-02-25  9:50 [Qemu-devel] [PATCH] Openpic: check that cpu id is within the number of cpus Fabien Chouteau
@ 2015-02-26 12:16 ` Alexander Graf
  2015-02-26 17:26   ` Fabien Chouteau
  0 siblings, 1 reply; 3+ messages in thread
From: Alexander Graf @ 2015-02-26 12:16 UTC (permalink / raw)
  To: Fabien Chouteau, qemu-devel, qemu-trivial



On 25.02.15 10:50, Fabien Chouteau wrote:
> Signed-off-by: Fabien Chouteau <chouteau@adacore.com>

Thanks, applied to ppc-next. Next time please include a commit message
though ;).


Alex

^ permalink raw reply	[flat|nested] 3+ messages in thread

* Re: [Qemu-devel] [PATCH] Openpic: check that cpu id is within the number of cpus
  2015-02-26 12:16 ` Alexander Graf
@ 2015-02-26 17:26   ` Fabien Chouteau
  0 siblings, 0 replies; 3+ messages in thread
From: Fabien Chouteau @ 2015-02-26 17:26 UTC (permalink / raw)
  To: Alexander Graf, qemu-devel, qemu-trivial

On 02/26/2015 01:16 PM, Alexander Graf wrote:
> 
> 
> On 25.02.15 10:50, Fabien Chouteau wrote:
>> Signed-off-by: Fabien Chouteau <chouteau@adacore.com>
> 
> Thanks, applied to ppc-next. Next time please include a commit message
> though ;).
> 


Noted.

Thanks Alex,

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2015-02-26 17:26 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2015-02-25  9:50 [Qemu-devel] [PATCH] Openpic: check that cpu id is within the number of cpus Fabien Chouteau
2015-02-26 12:16 ` Alexander Graf
2015-02-26 17:26   ` Fabien Chouteau

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).