File ocki-3.11.1-API-remove-unused-mutexes.patch of Package openCryptoki.14879

From 64730c36dabe7fab0c44019f274ca80365cd74b9 Mon Sep 17 00:00:00 2001
From: Ingo Franzki <ifranzki@linux.ibm.com>
Date: Tue, 8 Oct 2019 09:34:07 +0200
Subject: [PATCH] API: remove unused mutexes

ProcMutex and SessListMutex are created in C_Initialize,
but are never used nor destroyed anywhere.

Signed-off-by: Ingo Franzki <ifranzki@linux.ibm.com>
---
 usr/include/apictl.h        | 3 ---
 usr/lib/api/api_interface.c | 4 ----
 2 files changed, 7 deletions(-)

diff --git a/usr/include/apictl.h b/usr/include/apictl.h
index 29ae7826..baec5b1b 100644
--- a/usr/include/apictl.h
+++ b/usr/include/apictl.h
@@ -47,12 +47,9 @@ struct API_Slot {
 //
 typedef struct {
     pid_t Pid;
-    pthread_mutex_t ProcMutex;  // Mutex for the process level should this
-                                // be necessary
     key_t shm_tok;
 
     struct btree sess_btree;
-    pthread_mutex_t SessListMutex;      /*used to lock around btree accesses */
     void *SharedMemP;
     Slot_Mgr_Socket_t SocketDataP;
     uint16 MgrProcIndex;  // Index into shared memory for This process ctl block
diff --git a/usr/lib/api/api_interface.c b/usr/lib/api/api_interface.c
index 6e366f78..253d6969 100644
--- a/usr/lib/api/api_interface.c
+++ b/usr/lib/api/api_interface.c
@@ -2646,10 +2646,6 @@ CK_RV C_Initialize(CK_VOID_PTR pVoid)
     //                Free allocated Memory
     //                Return CKR_HOST_MEMORY
     memset((char *) Anchor, 0, sizeof(API_Proc_Struct_t));
-    // This is not shared across apps.
-    pthread_mutex_init(&(Anchor->ProcMutex), NULL);
-    // This is not shared across apps.
-    pthread_mutex_init(&(Anchor->SessListMutex), NULL);
     pthread_mutex_init(&GlobMutex, NULL);
     pthread_mutex_lock(&GlobMutex);
     Anchor->Pid = getpid();
-- 
2.13.7

openSUSE Build Service is sponsored by