Author: np
Date: Thu Mar 10 20:36:32 2016
New Revision: 296624
URL: https://svnweb.freebsd.org/changeset/base/296624

Log:
  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.

Modified:
  head/sys/dev/cxgbe/t4_main.c

Modified: head/sys/dev/cxgbe/t4_main.c
==============================================================================
--- head/sys/dev/cxgbe/t4_main.c        Thu Mar 10 20:15:27 2016        
(r296623)
+++ head/sys/dev/cxgbe/t4_main.c        Thu Mar 10 20:36:32 2016        
(r296624)
@@ -2084,7 +2084,7 @@ rw_via_memwin(struct adapter *sc, int id
        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);
_______________________________________________
svn-src-head@freebsd.org mailing list
https://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to