mirror of
https://gitlab.isc.org/isc-projects/bind9
synced 2025-09-03 16:15:27 +00:00
fix lock order reversal
This commit is contained in:
@@ -182,21 +182,20 @@ pk11_mem_put(void *ptr, size_t size) {
|
|||||||
|
|
||||||
isc_result_t
|
isc_result_t
|
||||||
pk11_initialize(isc_mem_t *mctx, const char *engine) {
|
pk11_initialize(isc_mem_t *mctx, const char *engine) {
|
||||||
isc_result_t result;
|
isc_result_t result = ISC_R_SUCCESS;
|
||||||
CK_RV rv;
|
CK_RV rv;
|
||||||
|
|
||||||
RUNTIME_CHECK(isc_once_do(&once, initialize) == ISC_R_SUCCESS);
|
RUNTIME_CHECK(isc_once_do(&once, initialize) == ISC_R_SUCCESS);
|
||||||
|
|
||||||
|
LOCK(&sessionlock);
|
||||||
LOCK(&alloclock);
|
LOCK(&alloclock);
|
||||||
if ((mctx != NULL) && (pk11_mctx == NULL) && (allocsize == 0))
|
if ((mctx != NULL) && (pk11_mctx == NULL) && (allocsize == 0))
|
||||||
isc_mem_attach(mctx, &pk11_mctx);
|
isc_mem_attach(mctx, &pk11_mctx);
|
||||||
|
UNLOCK(&alloclock);
|
||||||
if (initialized) {
|
if (initialized) {
|
||||||
UNLOCK(&alloclock);
|
goto unlock;
|
||||||
return (ISC_R_SUCCESS);
|
|
||||||
} else {
|
} else {
|
||||||
LOCK(&sessionlock);
|
|
||||||
initialized = true;
|
initialized = true;
|
||||||
UNLOCK(&alloclock);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
ISC_LIST_INIT(tokens);
|
ISC_LIST_INIT(tokens);
|
||||||
@@ -220,7 +219,6 @@ pk11_initialize(isc_mem_t *mctx, const char *engine) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
scan_slots();
|
scan_slots();
|
||||||
result = ISC_R_SUCCESS;
|
|
||||||
unlock:
|
unlock:
|
||||||
UNLOCK(&sessionlock);
|
UNLOCK(&sessionlock);
|
||||||
return (result);
|
return (result);
|
||||||
|
Reference in New Issue
Block a user