From: Yan Sonming <[email protected]>

Signed-off-by: Yan Sonming <[email protected]>
Signed-off-by: Mike Holmes <[email protected]>
---
 platform/linux-generic/include/odp_internal.h |  1 +
 platform/linux-generic/odp_crypto.c           | 13 +++++++++++++
 platform/linux-generic/odp_init.c             |  5 +++++
 3 files changed, 19 insertions(+)

diff --git a/platform/linux-generic/include/odp_internal.h 
b/platform/linux-generic/include/odp_internal.h
index 40c040f..430d2fb 100644
--- a/platform/linux-generic/include/odp_internal.h
+++ b/platform/linux-generic/include/odp_internal.h
@@ -49,6 +49,7 @@ int odp_classification_term_global(void);
 int odp_queue_init_global(void);
 
 int odp_crypto_init_global(void);
+int odp_crypto_term_global(void);
 
 int odp_schedule_init_global(void);
 int odp_schedule_init_local(void);
diff --git a/platform/linux-generic/odp_crypto.c 
b/platform/linux-generic/odp_crypto.c
index bc0f961..3572678 100644
--- a/platform/linux-generic/odp_crypto.c
+++ b/platform/linux-generic/odp_crypto.c
@@ -447,6 +447,19 @@ odp_crypto_init_global(void)
        return 0;
 }
 
+int odp_crypto_term_global(void)
+{
+       odp_shm_t shm;
+       int ret = 0;
+
+       shm = odp_shm_lookup("crypto_pool");
+       if (shm == ODP_SHM_INVALID)
+               return -1;
+       ret = odp_shm_free(shm);
+
+       return ret;
+}
+
 ssize_t
 odp_random_data(uint8_t *buf, ssize_t len, odp_bool_t use_entropy ODP_UNUSED)
 {
diff --git a/platform/linux-generic/odp_init.c 
b/platform/linux-generic/odp_init.c
index 91f4ee7..9c2f9e7 100644
--- a/platform/linux-generic/odp_init.c
+++ b/platform/linux-generic/odp_init.c
@@ -81,6 +81,11 @@ int odp_term_global(void)
                return -1;
        }
 
+       if (odp_crypto_term_global()) {
+               ODP_ERR("ODP crypto term failed.\n");
+               return -1;
+       }
+
        return 0;
 }
 
-- 
2.1.0


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

Reply via email to