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;
			       ^~~~
This commit is contained in:
dim 2015-07-28 09:19:04 +00:00
parent c3133372cb
commit 859189d7ec

View File

@ -302,7 +302,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;