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
This commit is contained in:
Dimitry Andric 2015-07-09 22:13:23 +00:00
parent 306a82f8f4
commit 4afafe0c86

View File

@ -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;