Skip site navigation (1)Skip section navigation (2)
Date:      Wed, 26 Sep 2018 02:27:37 +0000 (UTC)
From:      Navdeep Parhar <np@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r338940 - head/sys/dev/cxgbe
Message-ID:  <201809260227.w8Q2RbDS036662@repo.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: np
Date: Wed Sep 26 02:27:37 2018
New Revision: 338940
URL: https://svnweb.freebsd.org/changeset/base/338940

Log:
  cxgbe(4): Treat base/end of firmware parameters as signed integers when
  figuring out whether the range is valid or not.
  
  Approved by:	re@ (rgrimes@)
  MFC after:	1 week
  Sponsored by:	Chelsio Communications

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

Modified: head/sys/dev/cxgbe/t4_main.c
==============================================================================
--- head/sys/dev/cxgbe/t4_main.c	Tue Sep 25 23:59:45 2018	(r338939)
+++ head/sys/dev/cxgbe/t4_main.c	Wed Sep 26 02:27:37 2018	(r338940)
@@ -3851,7 +3851,7 @@ get_params__post_init(struct adapter *sc)
 
 	sc->sge.iq_start = val[0];
 	sc->sge.eq_start = val[1];
-	if (val[3] > val[2]) {
+	if ((int)val[3] > (int)val[2]) {
 		sc->tids.ftid_base = val[2];
 		sc->tids.ftid_end = val[3];
 		sc->tids.nftids = val[3] - val[2] + 1;
@@ -3986,7 +3986,7 @@ get_params__post_init(struct adapter *sc)
 			    "failed to query NIC parameters: %d.\n", rc);
 			return (rc);
 		}
-		if (val[1] > val[0]) {
+		if ((int)val[1] > (int)val[0]) {
 			sc->tids.etid_base = val[0];
 			sc->tids.etid_end = val[1];
 			sc->tids.netids = val[1] - val[0] + 1;
@@ -4016,7 +4016,7 @@ get_params__post_init(struct adapter *sc)
 			sc->tids.ntids -= sc->tids.nhpftids;
 		}
 		sc->tids.natids = min(sc->tids.ntids / 2, MAX_ATIDS);
-		if (val[2] > val[1]) {
+		if ((int)val[2] > (int)val[1]) {
 			sc->tids.stid_base = val[1];
 			sc->tids.nstids = val[2] - val[1] + 1;
 		}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201809260227.w8Q2RbDS036662>