diff mbox series

[V2,rdma-core,1/4] bnxt_re/lib: Check AH handler validity before use

Message ID 20210505171056.514204-2-devesh.sharma@broadcom.com (mailing list archive)
State Not Applicable
Headers show
Series Broadcom's rdma provider lib update | expand

Commit Message

Devesh Sharma May 5, 2021, 5:10 p.m. UTC
Provider library should check the validity of AH
handler before referencing it.

Fixing the AH validity check when initializing the
UD SQE from AH.

Fixes: 60ce22c59eaa ("Enable-UD-control-path-and-wqe-posting")
Signed-off-by: Devesh Sharma <devesh.sharma@broadcom.com>
---
 providers/bnxt_re/verbs.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
diff mbox series

Patch

diff --git a/providers/bnxt_re/verbs.c b/providers/bnxt_re/verbs.c
index ca561662..a015bed7 100644
--- a/providers/bnxt_re/verbs.c
+++ b/providers/bnxt_re/verbs.c
@@ -1193,13 +1193,13 @@  static int bnxt_re_build_ud_sqe(struct bnxt_re_qp *qp, void *wqe,
 	int len;
 
 	len = bnxt_re_build_send_sqe(qp, wqe, wr, is_inline);
-	sqe->qkey = htole32(wr->wr.ud.remote_qkey);
-	sqe->dst_qp = htole32(wr->wr.ud.remote_qpn);
 	if (!wr->wr.ud.ah) {
 		len = -EINVAL;
 		goto bail;
 	}
 	ah = to_bnxt_re_ah(wr->wr.ud.ah);
+	sqe->qkey = htole32(wr->wr.ud.remote_qkey);
+	sqe->dst_qp = htole32(wr->wr.ud.remote_qpn);
 	sqe->avid = htole32(ah->avid & 0xFFFFF);
 bail:
 	return len;