Commit 11a95521 authored by Jacob Moroni's avatar Jacob Moroni Committed by Leon Romanovsky
Browse files

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: b48c24c2 ("RDMA/irdma: Implement device supported verb APIs")
Signed-off-by: default avatarJacob Moroni <jmoroni@google.com>
Signed-off-by: default avatarTatyana Nikolova <tatyana.e.nikolova@intel.com>
Signed-off-by: default avatarLeon Romanovsky <leon@kernel.org>
parent 0f2055db
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -1105,6 +1105,7 @@ static int irdma_create_qp(struct ib_qp *ibqp,
	spin_lock_init(&iwqp->sc_qp.pfpdu.lock);
	iwqp->sig_all = init_attr->sq_sig_type == IB_SIGNAL_ALL_WR;
	rf->qp_table[qp_num] = iwqp;
	init_completion(&iwqp->free_qp);

	if (udata) {
		/* 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,
		}
	}

	init_completion(&iwqp->free_qp);
	return 0;

error: