[Pcsclite-cvs-commit] r6685 - trunk/Drivers/ccid/src

ludovic.rousseau at free.fr ludovic.rousseau at free.fr
Sun Jul 28 09:30:22 UTC 2013


Author: rousseau
Date: 2013-07-05 07:17:05 +0000 (Fri, 05 Jul 2013)
New Revision: 6685

Modified:
   trunk/Drivers/ccid/src/ifdhandler.c
Log:
CreateChannelByNameOrChannel(): correctly fails if the reader disapears

If we get the error IFD_NO_SUCH_DEVICE then we must exit using the error
path and not directly with a return.
We need to unlock a mutex and free allocated resources.

Thanks to coverity.


Modified: trunk/Drivers/ccid/src/ifdhandler.c
===================================================================
--- trunk/Drivers/ccid/src/ifdhandler.c	2013-07-05 07:11:41 UTC (rev 6684)
+++ trunk/Drivers/ccid/src/ifdhandler.c	2013-07-05 07:17:05 UTC (rev 6685)
@@ -141,7 +141,10 @@
 		/* The reader may have to start here so give it some time */
 		cmd_ret = CmdGetSlotStatus(reader_index, pcbuffer);
 		if (IFD_NO_SUCH_DEVICE == cmd_ret)
-			return cmd_ret;
+		{
+			return_value = cmd_ret;
+			goto error;
+		}
 
 		/* save the current read timeout computed from card capabilities */
 		oldReadTimeout = ccid_descriptor->readTimeout;




More information about the Pcsclite-cvs-commit mailing list