Date: Thu, 9 Jul 2015 22:13:23 +0000 (UTC) From: Dimitry Andric <dim@FreeBSD.org> To: src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org Subject: svn commit: r285340 - head/sys/dev/cxgb/ulp/iw_cxgb Message-ID: <201507092213.t69MDNDH020878@repo.freebsd.org>
next in thread | raw e-mail | index | archive | help
Author: dim Date: Thu Jul 9 22:13:23 2015 New Revision: 285340 URL: https://svnweb.freebsd.org/changeset/base/285340 Log: Fix swapped copyin(9) arguments in cxgb's iwch_arm_cq() function. Detected by clang 3.7.0 with the warning: sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_provider.c:309:18: error: variable 'rptr' is uninitialized when used here [-Werror,-Wuninitialized] chp->cq.rptr = rptr; ^~~~ MFC after: 1 week Modified: head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_provider.c Modified: head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_provider.c ============================================================================== --- head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_provider.c Thu Jul 9 21:53:40 2015 (r285339) +++ head/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_provider.c Thu Jul 9 22:13:23 2015 (r285340) @@ -303,7 +303,7 @@ iwch_arm_cq(struct ib_cq *ibcq, enum ib_ else cq_op = CQ_ARM_AN; if (chp->user_rptr_addr) { - if (copyin(&rptr, chp->user_rptr_addr, 4)) + if (copyin(chp->user_rptr_addr, &rptr, sizeof(rptr))) return (-EFAULT); mtx_lock(&chp->lock); chp->cq.rptr = rptr;
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201507092213.t69MDNDH020878>