From 6eebb1d138d1b88ffa2a64d82ad175d88847ce6c Mon Sep 17 00:00:00 2001 From: dim Date: Tue, 28 Jul 2015 09:19:04 +0000 Subject: [PATCH] MFC r285340: 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; ^~~~ git-svn-id: svn://svn.freebsd.org/base/stable/8@285942 ccf9f872-aa2e-dd11-9fc8-001c23d0bc1f --- sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_provider.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_provider.c b/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_provider.c index bc336a4a6..4d29df888 100644 --- a/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_provider.c +++ b/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_provider.c @@ -340,7 +340,7 @@ iwch_arm_cq(struct ib_cq *ibcq, enum ib_cq_notify_flags flags) 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; -- 2.42.0