Skip to content

Commit

Permalink
Resolves 126087. Backed out of slot->keyCount atomic instructions.
Browse files Browse the repository at this point in the history
  • Loading branch information
kirk.erickson%sun.com committed Apr 14, 2002
2 parents 6dd55d9 + 918f4bd commit 25c5e35
Showing 1 changed file with 5 additions and 8 deletions.
13 changes: 5 additions & 8 deletions security/nss/lib/pk11wrap/pk11skey.c
Expand Up @@ -165,12 +165,9 @@ pk11_getKeyFromList(PK11SlotInfo *slot) {
if (slot->freeSymKeysHead) {
symKey = slot->freeSymKeysHead;
slot->freeSymKeysHead = symKey->next;
PK11_USE_THREADS(PZ_Unlock(slot->freeListLock);)
PR_AtomicDecrement(&slot->keyCount);
}
else {
PK11_USE_THREADS(PZ_Unlock(slot->freeListLock);)
slot->keyCount--;
}
PK11_USE_THREADS(PZ_Unlock(slot->freeListLock);)
if (symKey) {
symKey->next = NULL;
if ((symKey->series != slot->series) || (!symKey->sessionOwner))
Expand Down Expand Up @@ -264,15 +261,15 @@ PK11_FreeSymKey(PK11SymKey *symKey)
PORT_Free(symKey->data.data);
}
slot = symKey->slot;
PK11_USE_THREADS(PZ_Lock(slot->freeListLock);)
if (slot->keyCount < slot->maxKeyCount) {
PK11_USE_THREADS(PZ_Lock(slot->freeListLock);)
symKey->next = slot->freeSymKeysHead;
slot->freeSymKeysHead = symKey;
slot->keyCount++;
symKey->slot = NULL;
PK11_USE_THREADS(PZ_Unlock(slot->freeListLock);)
PR_AtomicIncrement(&slot->keyCount);
freeit = PR_FALSE;
}
PK11_USE_THREADS(PZ_Unlock(slot->freeListLock);)
if (freeit) {
pk11_CloseSession(symKey->slot, symKey->session,
symKey->sessionOwner);
Expand Down

0 comments on commit 25c5e35

Please sign in to comment.