Openpic: check that cpu id is within the number of cpus
PATCH 1/1 Openpic: check that cpu id is within the number of cpus
Signed-off-by Fabien Chouteau <[email protected]>
--- hw/intc/openpic.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
hw/intc/openpic.c +2 -2
@@ -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; }
Signature · 1 line
1.7.9.5
Alexander Graf
AppliedQuoted 1 line · Fabien Chouteau
Signed-off-by Fabien Chouteau <[email protected]>
Thanks, applied to ppc-next. Next time please include a commit message though ;).
Alex
Quoted 8 lines · Alexander Graf
Quoted 1 line · Fabien Chouteau
Signed-off-by Fabien Chouteau <[email protected]>Thanks, applied to ppc-next. Next time please include a commit message though ;).
Noted.
Thanks Alex,