return;
bitmap_zero(map.bits, PNP_IRQ_NR);
- for (i = 0; i < p->interrupt_count; i++)
- if (p->interrupts[i])
- __set_bit(p->interrupts[i], map.bits);
+ for (i = 0; i < p->interrupt_count; i++) {
+ if (p->interrupts[i]) {
+ if (p->interrupts[i] < PNP_IRQ_NR)
+ __set_bit(p->interrupts[i], map.bits);
+ else
+ dev_err(&dev->dev, "ignoring IRQ %d option "
+ "(too large for %d entry bitmap)\n",
+ p->interrupts[i], PNP_IRQ_NR);
+ }
+ }
flags = irq_flags(p->triggering, p->polarity, p->sharable);
pnp_register_irq_resource(dev, option, &map, flags);