aboutsummaryrefslogtreecommitdiffstats
path: root/drivers/infiniband
diff options
context:
space:
mode:
Diffstat (limited to 'drivers/infiniband')
-rw-r--r--drivers/infiniband/hw/ipath/ipath_cq.c19
1 files changed, 14 insertions, 5 deletions
diff --git a/drivers/infiniband/hw/ipath/ipath_cq.c b/drivers/infiniband/hw/ipath/ipath_cq.c
index 08d8ae148cd0..d1380c7a1703 100644
--- a/drivers/infiniband/hw/ipath/ipath_cq.c
+++ b/drivers/infiniband/hw/ipath/ipath_cq.c
@@ -395,12 +395,9 @@ int ipath_resize_cq(struct ib_cq *ibcq, int cqe, struct ib_udata *udata)
395 goto bail; 395 goto bail;
396 } 396 }
397 397
398 /* 398 /* Check that we can write the offset to mmap. */
399 * Return the address of the WC as the offset to mmap.
400 * See ipath_mmap() for details.
401 */
402 if (udata && udata->outlen >= sizeof(__u64)) { 399 if (udata && udata->outlen >= sizeof(__u64)) {
403 __u64 offset = (__u64) wc; 400 __u64 offset = 0;
404 401
405 ret = ib_copy_to_udata(udata, &offset, sizeof(offset)); 402 ret = ib_copy_to_udata(udata, &offset, sizeof(offset));
406 if (ret) 403 if (ret)
@@ -450,6 +447,18 @@ int ipath_resize_cq(struct ib_cq *ibcq, int cqe, struct ib_udata *udata)
450 struct ipath_mmap_info *ip = cq->ip; 447 struct ipath_mmap_info *ip = cq->ip;
451 448
452 ipath_update_mmap_info(dev, ip, sz, wc); 449 ipath_update_mmap_info(dev, ip, sz, wc);
450
451 /*
452 * Return the offset to mmap.
453 * See ipath_mmap() for details.
454 */
455 if (udata && udata->outlen >= sizeof(__u64)) {
456 ret = ib_copy_to_udata(udata, &ip->offset,
457 sizeof(ip->offset));
458 if (ret)
459 goto bail;
460 }
461
453 spin_lock_irq(&dev->pending_lock); 462 spin_lock_irq(&dev->pending_lock);
454 if (list_empty(&ip->pending_mmaps)) 463 if (list_empty(&ip->pending_mmaps))
455 list_add(&ip->pending_mmaps, &dev->pending_mmaps); 464 list_add(&ip->pending_mmaps, &dev->pending_mmaps);