Skip to content

Commit 11a9552

Browse files
jakemoronirleon
authored andcommitted
RDMA/irdma: Initialize free_qp completion before using it
In irdma_create_qp, if ib_copy_to_udata fails, it will call irdma_destroy_qp to clean up which will attempt to wait on the free_qp completion, which is not initialized yet. Fix this by initializing the completion before the ib_copy_to_udata call. Fixes: b48c24c ("RDMA/irdma: Implement device supported verb APIs") Signed-off-by: Jacob Moroni <[email protected]> Signed-off-by: Tatyana Nikolova <[email protected]> Signed-off-by: Leon Romanovsky <[email protected]>
1 parent 0f2055d commit 11a9552

1 file changed

Lines changed: 1 addition & 1 deletion

File tree

drivers/infiniband/hw/irdma/verbs.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1105,6 +1105,7 @@ static int irdma_create_qp(struct ib_qp *ibqp,
11051105
spin_lock_init(&iwqp->sc_qp.pfpdu.lock);
11061106
iwqp->sig_all = init_attr->sq_sig_type == IB_SIGNAL_ALL_WR;
11071107
rf->qp_table[qp_num] = iwqp;
1108+
init_completion(&iwqp->free_qp);
11081109

11091110
if (udata) {
11101111
/* GEN_1 legacy support with libi40iw does not have expanded uresp struct */
@@ -1129,7 +1130,6 @@ static int irdma_create_qp(struct ib_qp *ibqp,
11291130
}
11301131
}
11311132

1132-
init_completion(&iwqp->free_qp);
11331133
return 0;
11341134

11351135
error:

0 commit comments

Comments
 (0)