Skip to content

Commit

Permalink
Add pthread_key_delete() to solve resource leak problem.
Browse files Browse the repository at this point in the history
This is based on pull request #112
(#112).

Change-Id: Ibfb99338d2cacdf890d4806e49f368afa900c245
Signed-off-by: Yunfeng Ye <yeyunfeng@huawei.com>
Signed-off-by: Yogaraj Alamenda <yogarajx.alamenda@intel.com>
Signed-off-by: Steve Linsell <stevenx.linsell@intel.com>
  • Loading branch information
yeyunfeng-dev authored and stevelinsell committed Feb 25, 2020
1 parent 2fc0979 commit 2859c37
Showing 1 changed file with 5 additions and 0 deletions.
5 changes: 5 additions & 0 deletions e_qat.c
Original file line number Diff line number Diff line change
Expand Up @@ -476,6 +476,7 @@ int qat_engine_init(ENGINE *e)
limitDevAccess)) {
WARN("icp_sal_userStart failed\n");
QATerr(QAT_F_QAT_ENGINE_INIT, QAT_R_ICP_SAL_USERSTART_FAIL);
pthread_key_delete(thread_local_variables);
pthread_mutex_unlock(&qat_engine_mutex);
return 0;
}
Expand Down Expand Up @@ -1146,6 +1147,10 @@ int qat_engine_finish_int(ENGINE *e, int reset_globals)
keep_polling = 1;
qatPerformOpRetries = 0;

DEBUG("Calling pthread_key_delete()\n");
pthread_key_delete(thread_local_variables);


/* Reset the configuration global variables (to their default values) only
* if requested, i.e. when we are not re-initializing the engine after
* forking
Expand Down

0 comments on commit 2859c37

Please sign in to comment.