mirror of
https://github.com/Motorhead1991/qemu.git
synced 2025-08-05 08:43:55 -06:00
hw/audio/cs4231a: fix assertion error in isa_bus_get_irq
This patch fixes an assertion error in isa_bus_get_irq() in /hw/isa/isa-bus.c by adding a constraint to the irq property. Patch v1 misused ISA_NUM_IRQS, pls ignore that. Signed-off-by: Zheng Huang <hz1624917200@gmail.com> Link: https://lore.kernel.org/r/6d228069-e38f-4c46-813f-edcccc5c47e4@gmail.com Signed-off-by: Paolo Bonzini <pbonzini@redhat.com>
This commit is contained in:
parent
428c0acd95
commit
bbdbc47b5c
1 changed files with 4 additions and 0 deletions
|
@ -682,6 +682,10 @@ static void cs4231a_realizefn (DeviceState *dev, Error **errp)
|
|||
return;
|
||||
}
|
||||
|
||||
if (s->irq >= ISA_NUM_IRQS) {
|
||||
error_setg(errp, "Invalid IRQ %d (max %d)", s->irq, ISA_NUM_IRQS - 1);
|
||||
return;
|
||||
}
|
||||
s->pic = isa_bus_get_irq(bus, s->irq);
|
||||
k = ISADMA_GET_CLASS(s->isa_dma);
|
||||
k->register_channel(s->isa_dma, s->dma, cs_dma_read, s);
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue