scd: Release the card reader after card removal.
authorNIIBE Yutaka <gniibe@fsij.org>
Fri, 2 Sep 2016 05:45:26 +0000 (14:45 +0900)
committerNIIBE Yutaka <gniibe@fsij.org>
Wed, 30 Nov 2016 00:13:16 +0000 (09:13 +0900)
* scd/command.c (update_reader_status_file): Call apdu_close_reader.

--
Backport of master commit: 8fe81055762d9c9e6f03fb7853a985c94ef73ac3

GnuPG-bug-id: 2651
Signed-off-by: NIIBE Yutaka <gniibe@fsij.org>
scd/command.c

index 451a922..e35579e 100644 (file)
@@ -2315,7 +2315,10 @@ update_reader_status_file (int set_card_removed_flag)
 
           /* Set the card removed flag for all current sessions.  */
           if (ss->any && ss->status == 0 && set_card_removed_flag)
-            update_card_removed (idx, 1);
+           {
+              apdu_close_reader (ss->slot);
+              update_card_removed (ss->slot, 1);
+           }
 
           ss->any = 1;