diff options
author | np <np@FreeBSD.org> | 2016-03-10 20:36:32 +0000 |
---|---|---|
committer | np <np@FreeBSD.org> | 2016-03-10 20:36:32 +0000 |
commit | 03f8f8e39672316bbe0cad522f381fab54de0b6e (patch) | |
tree | e746e6c669b5bf0da9c6353829cd6d8854666062 | |
parent | bc2429c936195064f74c61c4694a5ebd40d7cd2c (diff) | |
download | FreeBSD-src-03f8f8e39672316bbe0cad522f381fab54de0b6e.zip FreeBSD-src-03f8f8e39672316bbe0cad522f381fab54de0b6e.tar.gz |
cxgbe(4): Fix bug in r296603. The memory window needs to be
repositioned if the start address isn't in the window already. One
of the bounds check used the end address instead.
-rw-r--r-- | sys/dev/cxgbe/t4_main.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/sys/dev/cxgbe/t4_main.c b/sys/dev/cxgbe/t4_main.c index 8b71815..05a82b7 100644 --- a/sys/dev/cxgbe/t4_main.c +++ b/sys/dev/cxgbe/t4_main.c @@ -2084,7 +2084,7 @@ rw_via_memwin(struct adapter *sc, int idx, uint32_t addr, uint32_t *val, while (len > 0) { rw_rlock(&mw->mw_lock); mw_end = mw->mw_curpos + mw->mw_aperture; - if (addr >= mw_end || addr + len <= mw->mw_curpos) { + if (addr >= mw_end || addr < mw->mw_curpos) { /* Will need to reposition the window */ if (!rw_try_upgrade(&mw->mw_lock)) { rw_runlock(&mw->mw_lock); |