Blob Blame History Raw
From: Gal Pressman <galpress@amazon.com>
Date: Tue, 1 Dec 2020 11:17:24 +0200
Subject: RDMA/efa: Use the correct current and new states in modify QP
Patch-mainline: v5.10
Git-commit: 93416ab0f994f6cf16fa0c695577f8b19d30c533
References: git-fixes

The local variables cur_state and new_state hold the state that should be
used for the modify QP operation instead of the ones in the ib_qp_attr
struct.

Fixes: 40909f664d27 ("RDMA/efa: Add EFA verbs implementation")
Link: https://lore.kernel.org/r/20201201091724.37016-1-galpress@amazon.com
Reviewed-by: Firas JahJah <firasj@amazon.com>
Reviewed-by: Yossi Leybovich <sleybo@amazon.com>
Signed-off-by: Gal Pressman <galpress@amazon.com>
Signed-off-by: Jason Gunthorpe <jgg@nvidia.com>
Acked-by: Thomas Bogendoerfer <tbogendoerfer@suse.de>
---
 drivers/infiniband/hw/efa/efa_verbs.c |    4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)

--- a/drivers/infiniband/hw/efa/efa_verbs.c
+++ b/drivers/infiniband/hw/efa/efa_verbs.c
@@ -807,8 +807,8 @@ int efa_modify_qp(struct ib_qp *ibqp, st
 	if (qp_attr_mask & IB_QP_STATE) {
 		params.modify_mask |= BIT(EFA_ADMIN_QP_STATE_BIT) |
 				      BIT(EFA_ADMIN_CUR_QP_STATE_BIT);
-		params.cur_qp_state = qp_attr->cur_qp_state;
-		params.qp_state = qp_attr->qp_state;
+		params.cur_qp_state = cur_state;
+		params.qp_state = new_state;
 	}
 
 	if (qp_attr_mask & IB_QP_EN_SQD_ASYNC_NOTIFY) {