summaryrefslogtreecommitdiffstats
path: root/sys/dev/iwi
diff options
context:
space:
mode:
authorjhb <jhb@FreeBSD.org>2007-03-21 18:40:31 +0000
committerjhb <jhb@FreeBSD.org>2007-03-21 18:40:31 +0000
commitf372b09e82aa133caab5a6d13123293d6270ec7d (patch)
treecfb66fd4e8928eaec06ab73cba6af6397ff637d2 /sys/dev/iwi
parentb4b4be32dcf09b643b9e3eecd3971e380f2909fb (diff)
downloadFreeBSD-src-f372b09e82aa133caab5a6d13123293d6270ec7d.zip
FreeBSD-src-f372b09e82aa133caab5a6d13123293d6270ec7d.tar.gz
Fix an off-by-one error in iwi_init_fw_dma(). It didn't reuse the existing
DMA memory for a firmware load if it was the exact size needed, thus in the common case the driver was constantly free'ing and reallocating the DMA buffer and it would eventually begin to fail. With this fix, iwi0 reuses the same buffer the entire time and no longer fails to load the firmware after the machine has been up for a while. MFC after: 1 week
Diffstat (limited to 'sys/dev/iwi')
-rw-r--r--sys/dev/iwi/if_iwi.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/dev/iwi/if_iwi.c b/sys/dev/iwi/if_iwi.c
index e97d76e..c694c92 100644
--- a/sys/dev/iwi/if_iwi.c
+++ b/sys/dev/iwi/if_iwi.c
@@ -3093,7 +3093,7 @@ iwi_release_fw_dma(struct iwi_softc *sc)
static int
iwi_init_fw_dma(struct iwi_softc *sc, int size)
{
- if (sc->fw_dma_size > size)
+ if (sc->fw_dma_size >= size)
return 0;
if (bus_dma_tag_create(bus_get_dma_tag(sc->sc_dev), 4, 0,
BUS_SPACE_MAXADDR_32BIT, BUS_SPACE_MAXADDR, NULL, NULL,
OpenPOWER on IntegriCloud