diff options
| author | Steven Hartland <smh@FreeBSD.org> | 2014-12-21 16:15:29 +0000 |
|---|---|---|
| committer | Steven Hartland <smh@FreeBSD.org> | 2014-12-21 16:15:29 +0000 |
| commit | a12f5777dfaa5be4dbd91cecea090c1456717ef5 (patch) | |
| tree | 2fcce32e42b8c0bd12cad6b12fe2c56ff4931956 /sys/dev | |
| parent | 55972826f2b0109d1b26864fdfce195da8aa18d2 (diff) | |
Notes
Diffstat (limited to 'sys/dev')
| -rw-r--r-- | sys/dev/ahci/ahci.c | 8 |
1 files changed, 8 insertions, 0 deletions
diff --git a/sys/dev/ahci/ahci.c b/sys/dev/ahci/ahci.c index 583983bff7ec5..8b4066f5820dd 100644 --- a/sys/dev/ahci/ahci.c +++ b/sys/dev/ahci/ahci.c @@ -356,6 +356,14 @@ ahci_setup_interrupt(device_t dev) device_printf(dev, "Falling back to one MSI\n"); ctlr->numirqs = 1; } + + /* Ensure we don't overrun irqs. */ + if (ctlr->numirqs > AHCI_MAX_IRQS) { + device_printf(dev, "Too many irqs %d > %d (clamping)\n", + ctlr->numirqs, AHCI_MAX_IRQS); + ctlr->numirqs = AHCI_MAX_IRQS; + } + /* Allocate all IRQs. */ for (i = 0; i < ctlr->numirqs; i++) { ctlr->irqs[i].ctlr = ctlr; |
