|
|
3d912a |
# HG changeset patch
|
|
|
3d912a |
# User Daiki Ueno <dueno@redhat.com>
|
|
|
3d912a |
# Date 1557150127 -7200
|
|
|
3d912a |
# Mon May 06 15:42:07 2019 +0200
|
|
|
3d912a |
# Node ID 438ac983bda9ec7944990d22a37877e9111caa90
|
|
|
3d912a |
# Parent b018f3e84d87cce99a1fd81feeecb31123058687
|
|
|
3d912a |
pk11slot: reference module from slot for finalization
|
|
|
3d912a |
|
|
|
3d912a |
diff --git a/lib/pk11wrap/pk11slot.c b/lib/pk11wrap/pk11slot.c
|
|
|
3d912a |
--- a/lib/pk11wrap/pk11slot.c
|
|
|
3d912a |
+++ b/lib/pk11wrap/pk11slot.c
|
|
|
3d912a |
@@ -1439,6 +1439,11 @@ PK11_InitSlot(SECMODModule *mod, CK_SLOT
|
|
|
3d912a |
slot->slotID = slotID;
|
|
|
3d912a |
slot->isThreadSafe = mod->isThreadSafe;
|
|
|
3d912a |
slot->hasRSAInfo = PR_FALSE;
|
|
|
3d912a |
+ slot->module = mod; /* NOTE: we don't make a reference here because
|
|
|
3d912a |
+ * modules have references to their slots. This
|
|
|
3d912a |
+ * works because modules keep implicit references
|
|
|
3d912a |
+ * from their slots, and won't unload and disappear
|
|
|
3d912a |
+ * until all their slots have been freed */
|
|
|
3d912a |
|
|
|
3d912a |
if (PK11_GETTAB(slot)->C_GetSlotInfo(slotID, &slotInfo) != CKR_OK) {
|
|
|
3d912a |
slot->disabled = PR_TRUE;
|
|
|
3d912a |
@@ -1448,11 +1453,6 @@ PK11_InitSlot(SECMODModule *mod, CK_SLOT
|
|
|
3d912a |
|
|
|
3d912a |
/* test to make sure claimed mechanism work */
|
|
|
3d912a |
slot->needTest = mod->internal ? PR_FALSE : PR_TRUE;
|
|
|
3d912a |
- slot->module = mod; /* NOTE: we don't make a reference here because
|
|
|
3d912a |
- * modules have references to their slots. This
|
|
|
3d912a |
- * works because modules keep implicit references
|
|
|
3d912a |
- * from their slots, and won't unload and disappear
|
|
|
3d912a |
- * until all their slots have been freed */
|
|
|
3d912a |
(void)PK11_MakeString(NULL, slot->slot_name,
|
|
|
3d912a |
(char *)slotInfo.slotDescription, sizeof(slotInfo.slotDescription));
|
|
|
3d912a |
slot->isHW = (PRBool)((slotInfo.flags & CKF_HW_SLOT) == CKF_HW_SLOT);
|