According to odp_crypto_session_create it should either return
session handle in session_out out parameter or set it to
ODP_CRYPTO_SESSION_INVALID. Genetic crypto implementation did not do
that. Fix it by presetting *session_out to ODP_CRYPTO_SESSION_INVALID.

Signed-off-by: Victor Kamensky <[email protected]>
---
 platform/linux-generic/odp_crypto.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/platform/linux-generic/odp_crypto.c 
b/platform/linux-generic/odp_crypto.c
index 8782d99..ef91a34 100644
--- a/platform/linux-generic/odp_crypto.c
+++ b/platform/linux-generic/odp_crypto.c
@@ -262,9 +262,12 @@ odp_crypto_session_create(odp_crypto_session_params_t 
*params,
        int rc;
        odp_crypto_generic_session_t *session;
 
-       /* Default to successful result */
+       /* Default return to successful result */
        *status = ODP_CRYPTO_SES_CREATE_ERR_NONE;
 
+       /* Default session to failure result */
+       *session_out = ODP_CRYPTO_SESSION_INVALID;
+
        /* Allocate memory for this session */
        session = alloc_session();
        if (NULL == session) {
-- 
1.8.1.4


_______________________________________________
lng-odp mailing list
[email protected]
http://lists.linaro.org/mailman/listinfo/lng-odp

Reply via email to