diff mbox

[2/3] validation: crypto: verify odp_crypto_operation() return code

Message ID 1424862845-18733-3-git-send-email-taras.kondratiuk@linaro.org
State Accepted
Commit 46d3f78ae6843e5510fffd1aea5dd778641ad925
Headers show

Commit Message

Taras Kondratiuk Feb. 25, 2015, 11:14 a.m. UTC
It doesn't make sense to process crypto operation results if operation
have failed.

Signed-off-by: Taras Kondratiuk <taras.kondratiuk@linaro.org>
---
 test/validation/crypto/odp_crypto_test_async_inp.c | 4 ++++
 1 file changed, 4 insertions(+)
diff mbox

Patch

diff --git a/test/validation/crypto/odp_crypto_test_async_inp.c b/test/validation/crypto/odp_crypto_test_async_inp.c
index 53bb8d9..9f449e4 100644
--- a/test/validation/crypto/odp_crypto_test_async_inp.c
+++ b/test/validation/crypto/odp_crypto_test_async_inp.c
@@ -91,6 +91,10 @@  static void alg_test(enum odp_crypto_op op,
 	}
 
 	rc = odp_crypto_operation(&op_params, &posted, NULL);
+	if (rc < 0) {
+		odp_packet_free(pkt);
+		CU_FAIL_FATAL("Failed odp_crypto_operation()");
+	}
 	CU_ASSERT(posted);
 
 	/* Poll completion queue for results */