[Pcsclite-cvs-commit] CVS Drivers/ccid/src

CVS User rousseau ludovic.rousseau@free.fr
Sat, 04 Jun 2005 09:44:31 +0000


Update of /cvsroot/pcsclite/Drivers/ccid/src
In directory haydn:/tmp/cvs-serv22337/src

Modified Files:
	ccid_usb.c 
Log Message:
WriteUSB(): do not parse usbDevice[reader_index].dev->bus if it is a
NULL pointer (the device has been removed for example)


--- /cvsroot/pcsclite/Drivers/ccid/src/ccid_usb.c	2005/05/02 09:19:36	1.58
+++ /cvsroot/pcsclite/Drivers/ccid/src/ccid_usb.c	2005/06/04 09:44:31	1.59
@@ -18,7 +18,7 @@
 */
 
 /*
- * $Id: ccid_usb.c,v 1.58 2005/05/02 09:19:36 rousseau Exp $
+ * $Id: ccid_usb.c,v 1.59 2005/06/04 09:44:31 rousseau Exp $
  */
 
 #define __CCID_USB__
@@ -442,9 +442,15 @@
 
 	if (rv < 0)
 	{
-		DEBUG_CRITICAL4("usb_bulk_write(%s/%s): %s",
-			usbDevice[reader_index].dev->bus->dirname,
-			usbDevice[reader_index].dev->filename, strerror(errno));
+		if (usbDevice[reader_index].dev->bus)
+		{
+			DEBUG_CRITICAL4("usb_bulk_write(%s/%s): %s",
+				usbDevice[reader_index].dev->bus->dirname,
+				usbDevice[reader_index].dev->filename, strerror(errno));
+		}
+		else
+			DEBUG_CRITICAL2("usb_bulk_write(no device): %s", strerror(errno));
+
 		return STATUS_UNSUCCESSFUL;
 	}