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.
This commit is contained in:
Navdeep Parhar 2016-03-10 20:36:32 +00:00
parent 68b6279b1a
commit 30d816a7b5

View File

@ -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);