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;
_______________________________________________
svn-src-head@freebsd.org mailing list
http://lists.freebsd.org/mailman/listinfo/svn-src-head
To unsubscribe, send any mail to "svn-src-head-unsubscr...@freebsd.org"

Reply via email to