svn commit: r331869 - head/sys/dev/nxge

Ian Lepore ian at FreeBSD.org
Sun Apr 1 18:53:28 UTC 2018


Author: ian
Date: Sun Apr  1 18:53:27 2018
New Revision: 331869
URL: https://svnweb.freebsd.org/changeset/base/331869

Log:
  Fix the build on arches with default unsigned char.  Capture the fubyte()
  return value in an int as well as the char, and test the full int value
  for fubyte() failure.

Modified:
  head/sys/dev/nxge/if_nxge.c

Modified: head/sys/dev/nxge/if_nxge.c
==============================================================================
--- head/sys/dev/nxge/if_nxge.c	Sun Apr  1 18:22:24 2018	(r331868)
+++ head/sys/dev/nxge/if_nxge.c	Sun Apr  1 18:53:27 2018	(r331869)
@@ -1366,12 +1366,13 @@ xge_ioctl_stats(xge_lldev_t *lldev, struct ifreq *ifre
 	xge_hal_status_e status = XGE_HAL_OK;
 	char cmd, mode;
 	void *info = NULL;
-	int retValue = EINVAL;
+	int retValue;
 
-	cmd = fubyte(ifr_data_get_ptr(ifreqp));
-	if (cmd == -1)
+	cmd = retValue = fubyte(ifr_data_get_ptr(ifreqp));
+	if (retValue == -1)
 		return (EFAULT);
 
+	retValue = EINVAL;
 	switch(cmd) {
 	    case XGE_QUERY_STATS:
 	        mtx_lock(&lldev->mtx_drv);


More information about the svn-src-head mailing list