[1/2] crypto/qat: fix uncleared cookies in asym

Message ID 20220928155811.25016-1-arkadiuszx.kusztal@intel.com (mailing list archive)
State Superseded, archived
Delegated to: akhil goyal
Headers
Series [1/2] crypto/qat: fix uncleared cookies in asym |

Checks

Context Check Description
ci/checkpatch success coding style OK

Commit Message

Arkadiusz Kusztal Sept. 28, 2022, 3:58 p.m. UTC
  Fixed incorrectly placed clean function in asym response.

Fixes: 002486db239e ("crypto/qat: refactor asymmetric session")

Signed-off-by: Arek Kusztal <arkadiuszx.kusztal@intel.com>
---
 drivers/crypto/qat/qat_asym.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)
  

Patch

diff --git a/drivers/crypto/qat/qat_asym.c b/drivers/crypto/qat/qat_asym.c
index 19931791c4..4b0538eea8 100644
--- a/drivers/crypto/qat/qat_asym.c
+++ b/drivers/crypto/qat/qat_asym.c
@@ -906,6 +906,8 @@  qat_asym_process_response(void **out_op, uint8_t *resp,
 					" returned error");
 		}
 	}
+	if (op->status == RTE_CRYPTO_OP_STATUS_ERROR)
+		goto finalize;
 
 	switch (op->sess_type) {
 	case RTE_CRYPTO_OP_WITH_SESSION:
@@ -923,9 +925,10 @@  qat_asym_process_response(void **out_op, uint8_t *resp,
 	if (op->status == RTE_CRYPTO_OP_STATUS_NOT_PROCESSED) {
 		op->status = qat_asym_collect_response(op,
 					cookie, xform);
-		cleanup(cookie, xform, cookie->alg_bytesize);
 	}
 
+finalize:
+	cleanup(cookie, xform, cookie->alg_bytesize);
 	*out_op = op;
 	HEXDUMP("resp_msg:", resp_msg, sizeof(struct icp_qat_fw_pke_resp));