Date: Sun, 1 Apr 2018 18:53:27 +0000 (UTC) From: Ian Lepore <ian@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r331869 - head/sys/dev/nxge Message-ID: <201804011853.w31IrR5X003323@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
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);
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201804011853.w31IrR5X003323>