aboutsummaryrefslogtreecommitdiffstats
path: root/drivers
diff options
context:
space:
mode:
Diffstat (limited to 'drivers')
-rw-r--r--drivers/infiniband/hw/ipath/ipath_cq.c11
1 files changed, 7 insertions, 4 deletions
diff --git a/drivers/infiniband/hw/ipath/ipath_cq.c b/drivers/infiniband/hw/ipath/ipath_cq.c
index 645ed71fd797..08d8ae148cd0 100644
--- a/drivers/infiniband/hw/ipath/ipath_cq.c
+++ b/drivers/infiniband/hw/ipath/ipath_cq.c
@@ -404,7 +404,7 @@ int ipath_resize_cq(struct ib_cq *ibcq, int cqe, struct ib_udata *udata)
404 404
405 ret = ib_copy_to_udata(udata, &offset, sizeof(offset)); 405 ret = ib_copy_to_udata(udata, &offset, sizeof(offset));
406 if (ret) 406 if (ret)
407 goto bail; 407 goto bail_free;
408 } 408 }
409 409
410 spin_lock_irq(&cq->lock); 410 spin_lock_irq(&cq->lock);
@@ -424,10 +424,8 @@ int ipath_resize_cq(struct ib_cq *ibcq, int cqe, struct ib_udata *udata)
424 else 424 else
425 n = head - tail; 425 n = head - tail;
426 if (unlikely((u32)cqe < n)) { 426 if (unlikely((u32)cqe < n)) {
427 spin_unlock_irq(&cq->lock);
428 vfree(wc);
429 ret = -EOVERFLOW; 427 ret = -EOVERFLOW;
430 goto bail; 428 goto bail_unlock;
431 } 429 }
432 for (n = 0; tail != head; n++) { 430 for (n = 0; tail != head; n++) {
433 if (cq->ip) 431 if (cq->ip)
@@ -459,7 +457,12 @@ int ipath_resize_cq(struct ib_cq *ibcq, int cqe, struct ib_udata *udata)
459 } 457 }
460 458
461 ret = 0; 459 ret = 0;
460 goto bail;
462 461
462bail_unlock:
463 spin_unlock_irq(&cq->lock);
464bail_free:
465 vfree(wc);
463bail: 466bail:
464 return ret; 467 return ret;
465} 468}