svn commit: r296624 - head/sys/dev/cxgbe

Navdeep Parhar np at FreeBSD.org
Thu Mar 10 20:36:33 UTC 2016


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


More information about the svn-src-all mailing list