diff options
author | Brad Smith <brad@cvs.openbsd.org> | 2006-04-07 01:07:42 +0000 |
---|---|---|
committer | Brad Smith <brad@cvs.openbsd.org> | 2006-04-07 01:07:42 +0000 |
commit | 53258d50bdc55304207b90571af0662bdf8a239f (patch) | |
tree | 14d9928e085a5b57a9db962883896fe4f60b0323 /sys/dev/pci | |
parent | 2b1cfc3386b297ab81942c33c83f0d3e7793efaa (diff) |
Don't check for a BAR address past PCI_MAPREG_END; some devices
have BARs way out in left field.
From NetBSD
Diffstat (limited to 'sys/dev/pci')
-rw-r--r-- | sys/dev/pci/pci_map.c | 22 |
1 files changed, 19 insertions, 3 deletions
diff --git a/sys/dev/pci/pci_map.c b/sys/dev/pci/pci_map.c index 92c73b14ceb..ecae4efdaea 100644 --- a/sys/dev/pci/pci_map.c +++ b/sys/dev/pci/pci_map.c @@ -1,4 +1,4 @@ -/* $OpenBSD: pci_map.c,v 1.14 2006/04/07 01:04:49 brad Exp $ */ +/* $OpenBSD: pci_map.c,v 1.15 2006/04/07 01:07:41 brad Exp $ */ /* $NetBSD: pci_map.c,v 1.7 2000/05/10 16:58:42 thorpej Exp $ */ /*- @@ -61,7 +61,15 @@ obsd_pci_io_find(pci_chipset_tag_t pc, pcitag_t tag, int reg, pcireg_t type, pcireg_t address, mask; int s; - if (reg < PCI_MAPREG_START || reg >= PCI_MAPREG_END || (reg & 3)) + if (reg < PCI_MAPREG_START || +#if 0 + /* + * Can't do this check; some devices have mapping registers + * way out in left field. + */ + reg >= PCI_MAPREG_END || +#endif + (reg & 3)) panic("pci_io_find: bad request"); /* @@ -115,7 +123,15 @@ obsd_pci_mem_find(pci_chipset_tag_t pc, pcitag_t tag, int reg, pcireg_t type, is64bit = (PCI_MAPREG_MEM_TYPE(type) == PCI_MAPREG_MEM_TYPE_64BIT); - if (reg < PCI_MAPREG_START || reg >= PCI_MAPREG_END || (reg & 3)) + if (reg < PCI_MAPREG_START || +#if 0 + /* + * Can't do this check; some devices have mapping registers + * way out in left field. + */ + reg >= PCI_MAPREG_END || +#endif + (reg & 3)) panic("pci_mem_find: bad request"); if (is64bit && (reg + 4) >= PCI_MAPREG_END) |