summaryrefslogtreecommitdiffstats
path: root/scd/apdu.c
diff options
context:
space:
mode:
authorNIIBE Yutaka <gniibe@fsij.org>2020-07-17 04:11:45 +0200
committerNIIBE Yutaka <gniibe@fsij.org>2020-07-17 04:11:45 +0200
commit46d185f60397f68830bfdfb99627b29aea5016f1 (patch)
tree32f13708595decc01534906d0d72df050976176d /scd/apdu.c
parentgpg-card: Fix type of historyname. (diff)
downloadgnupg2-46d185f60397f68830bfdfb99627b29aea5016f1.tar.xz
gnupg2-46d185f60397f68830bfdfb99627b29aea5016f1.zip
scd: PC/SC: Don't release the context when it's in use.
* scd/apdu.c (close_pcsc_reader): Check if it's not in the loop. -- GnuPG-bug-id: 4998 Reported-by: Kevin Locke Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
Diffstat (limited to 'scd/apdu.c')
-rw-r--r--scd/apdu.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/scd/apdu.c b/scd/apdu.c
index 46d18b14b..33951a2da 100644
--- a/scd/apdu.c
+++ b/scd/apdu.c
@@ -813,7 +813,7 @@ static int
close_pcsc_reader (int slot)
{
(void)slot;
- if (--pcsc.count == 0)
+ if (--pcsc.count == 0 && npth_mutex_trylock (&reader_table_lock) == 0)
{
int i;