aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2015-07-09 22:13:23 +0000
committerDimitry Andric <dim@FreeBSD.org>2015-07-09 22:13:23 +0000
commit4afafe0c86accda2b2a03912f9560d0a5a155270 (patch)
tree894ef090872018c7e9d80aab513e8689bd6e9454
parent306a82f8f49f302f1442df404b47dd80d63d2936 (diff)
downloadsrc-4afafe0c86accda2b2a03912f9560d0a5a155270.tar.gz
src-4afafe0c86accda2b2a03912f9560d0a5a155270.zip
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
Notes
Notes: svn path=/head/; revision=285340
-rw-r--r--sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_provider.c2
1 files changed, 1 insertions, 1 deletions
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 8f4980fac9d6..f9d36b32c006 100644
--- a/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_provider.c
+++ b/sys/dev/cxgb/ulp/iw_cxgb/iw_cxgb_provider.c
@@ -303,7 +303,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;