diff mbox

hw/intc/exynos4210_combiner: Don't overrun output_irq array in init

Message ID 1392659611-8439-1-git-send-email-peter.maydell@linaro.org
State Superseded
Headers show

Commit Message

Peter Maydell Feb. 17, 2014, 5:53 p.m. UTC
The Exynos4210 combiner has IIC_NIRQ inputs and IIC_NGRP outputs;
use the correct constant in the loop initializing our output
sysbus IRQs so that we don't overrun the output_irq[] array.

Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
---
 hw/intc/exynos4210_combiner.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

Comments

Peter Maydell Feb. 24, 2014, 3:44 p.m. UTC | #1
On 18 February 2014 01:17, Andreas Färber <afaerber@suse.de> wrote:
> Am 17.02.2014 18:53, schrieb Peter Maydell:
>> The Exynos4210 combiner has IIC_NIRQ inputs and IIC_NGRP outputs;
>> use the correct constant in the loop initializing our output
>> sysbus IRQs so that we don't overrun the output_irq[] array.
>>
>> Signed-off-by: Peter Maydell <peter.maydell@linaro.org>
>> ---
>>  hw/intc/exynos4210_combiner.c | 2 +-
>>  1 file changed, 1 insertion(+), 1 deletion(-)
>>
>> diff --git a/hw/intc/exynos4210_combiner.c b/hw/intc/exynos4210_combiner.c
>> index ef5e8eb..3287479 100644
>> --- a/hw/intc/exynos4210_combiner.c
>> +++ b/hw/intc/exynos4210_combiner.c
>> @@ -418,7 +418,7 @@ static int exynos4210_combiner_init(SysBusDevice *sbd)
>>      qdev_init_gpio_in(dev, exynos4210_combiner_handler, IIC_NIRQ);
>>
>>      /* Connect SysBusDev irqs to device specific irqs */
>> -    for (i = 0; i < IIC_NIRQ; i++) {
>> +    for (i = 0; i < IIC_NGRP; i++) {
>
> Reviewed-by: Andreas Färber <afaerber@suse.de>
>
> It seems that IIC_NIRQ == IIC_NGRP * 8, so please don't forget to Cc
> qemu-stable@nongnu.org in the commit message for 1.7.1.

Thanks; applied to target-arm.next and added the cc:stable line.

-- PMM
diff mbox

Patch

diff --git a/hw/intc/exynos4210_combiner.c b/hw/intc/exynos4210_combiner.c
index ef5e8eb..3287479 100644
--- a/hw/intc/exynos4210_combiner.c
+++ b/hw/intc/exynos4210_combiner.c
@@ -418,7 +418,7 @@  static int exynos4210_combiner_init(SysBusDevice *sbd)
     qdev_init_gpio_in(dev, exynos4210_combiner_handler, IIC_NIRQ);
 
     /* Connect SysBusDev irqs to device specific irqs */
-    for (i = 0; i < IIC_NIRQ; i++) {
+    for (i = 0; i < IIC_NGRP; i++) {
         sysbus_init_irq(sbd, &s->output_irq[i]);
     }