On Tue, 3 Nov 2026 at 15:50, Mark Cave-Ayland
<[email protected]> wrote:
>
> Commit 54fbbb30d44e ("i8259.c: introduce TYPE_I8259_PIC device") introduced a
> separate output IRQ for a PIC representing a cascaded i8259 configuration, but
> failed to free it afterwards. Use qemu_init_irq_child() so that the IRQ is
> automatically freed when the PIC device is finalized.
>
> Reported-by: Peter Maydell <[email protected]>
> Fixes: 54fbbb30d44e ("i8259.c: introduce TYPE_I8259_PIC device")
> Signed-off-by: Mark Cave-Ayland <[email protected]>
> ---
>  hw/intc/i8259.c | 3 ++-
>  1 file changed, 2 insertions(+), 1 deletion(-)
>
> diff --git a/hw/intc/i8259.c b/hw/intc/i8259.c
> index 79b5e603bc..6c784ef2a4 100644
> --- a/hw/intc/i8259.c
> +++ b/hw/intc/i8259.c
> @@ -491,7 +491,8 @@ static void i8259_pic_init(Object *obj)
>      object_initialize_child(obj, "primary", &s->i8259[0], TYPE_I8259);
>      object_initialize_child(obj, "secondary", &s->i8259[1], TYPE_I8259);
>
> -    qemu_init_irq(&s->i8259_primary_out_irq, i8259_primary_out_irq, s, 1);
> +    qemu_init_irq_child(obj, "output-irq", &s->i8259_primary_out_irq,
> +                        i8259_primary_out_irq, s, 1);
>
>      qdev_init_gpio_in(DEVICE(obj), i8259_pic_set_irq, ISA_NUM_IRQS);
>      qdev_init_gpio_out(DEVICE(obj), &s->pic_out_irq, 1);
> --
> 2.43.0

Reviewed-by: Peter Maydell <[email protected]>

thanks
-- PMM

Reply via email to