aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--drivers/infiniband/hw/mlx4/qp.c8
1 files changed, 5 insertions, 3 deletions
diff --git a/drivers/infiniband/hw/mlx4/qp.c b/drivers/infiniband/hw/mlx4/qp.c
index 5456bc4aff7c..f6315dfb213e 100644
--- a/drivers/infiniband/hw/mlx4/qp.c
+++ b/drivers/infiniband/hw/mlx4/qp.c
@@ -415,9 +415,11 @@ static int create_qp_common(struct mlx4_ib_dev *dev, struct ib_pd *pd,
415 return 0; 415 return 0;
416 416
417err_wrid: 417err_wrid:
418 if (pd->uobject && !init_attr->srq) 418 if (pd->uobject) {
419 mlx4_ib_db_unmap_user(to_mucontext(pd->uobject->context), &qp->db); 419 if (!init_attr->srq)
420 else { 420 mlx4_ib_db_unmap_user(to_mucontext(pd->uobject->context),
421 &qp->db);
422 } else {
421 kfree(qp->sq.wrid); 423 kfree(qp->sq.wrid);
422 kfree(qp->rq.wrid); 424 kfree(qp->rq.wrid);
423 } 425 }