projects
/
dragonfly.git
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
03301eb
)
pci: Guard against wrong user supplied IRQ assignment
author
Sepherosa Ziehau
<sephe@dragonflybsd.org>
Tue, 28 Aug 2012 06:02:10 +0000
(14:02 +0800)
committer
Sepherosa Ziehau
<sephe@dragonflybsd.org>
Tue, 28 Aug 2012 06:02:10 +0000
(14:02 +0800)
sys/bus/pci/pci.c
patch
|
blob
|
blame
|
history
diff --git
a/sys/bus/pci/pci.c
b/sys/bus/pci/pci.c
index
1fb6d95
..
ad8b277
100644
(file)
--- a/
sys/bus/pci/pci.c
+++ b/
sys/bus/pci/pci.c
@@
-2701,8
+2701,17
@@
pci_assign_interrupt(device_t bus, device_t dev, int force_route)
if (irq >= 255 || irq <= 0) {
irq = PCI_INVALID_IRQ;
} else {
if (irq >= 255 || irq <= 0) {
irq = PCI_INVALID_IRQ;
} else {
- BUS_CONFIG_INTR(bus, dev, irq,
- INTR_TRIGGER_LEVEL, INTR_POLARITY_LOW);
+ if (machintr_legacy_intr_find(irq,
+ INTR_TRIGGER_LEVEL, INTR_POLARITY_LOW) < 0) {
+ device_printf(dev,
+ "hw.pci%d.%d.%d.%d.INT%c.irq=%d, invalid\n",
+ cfg->domain, cfg->bus, cfg->slot, cfg->func,
+ cfg->intpin + 'A' - 1, irq);
+ irq = PCI_INVALID_IRQ;
+ } else {
+ BUS_CONFIG_INTR(bus, dev, irq,
+ INTR_TRIGGER_LEVEL, INTR_POLARITY_LOW);
+ }
}
}
}
}