[Pcsclite-cvs-commit] r2743 - /trunk/PCSC/src/hotplug_libusb.c

rousseau at users.alioth.debian.org rousseau at users.alioth.debian.org
Tue Jan 15 15:21:30 UTC 2008


Author: rousseau
Date: Tue Jan 15 15:21:30 2008
New Revision: 2743

URL: http://svn.debian.org/wsvn/pcsclite/?sc=1&rev=2743
Log:
HPAddHotPluggable(): lock the mutex _after_ every possible return. (May
cause a deadlock)

Modified:
    trunk/PCSC/src/hotplug_libusb.c

Modified: trunk/PCSC/src/hotplug_libusb.c
URL: http://svn.debian.org/wsvn/pcsclite/trunk/PCSC/src/hotplug_libusb.c?rev=2743&op=diff
==============================================================================
--- trunk/PCSC/src/hotplug_libusb.c (original)
+++ trunk/PCSC/src/hotplug_libusb.c Tue Jan 15 15:21:30 2008
@@ -473,8 +473,6 @@
 	int i;
 	char deviceName[MAX_DEVICENAME];
 
-	SYS_MutexLock(&usbNotifierMutex);
-
 	Log2(PCSC_LOG_INFO, "Adding USB device: %s", bus_device);
 
 	snprintf(deviceName, sizeof(deviceName), "usb:%04x/%04x:libusb:%s",
@@ -494,6 +492,8 @@
 			"Not enough reader entries. Already found %d readers", i);
 		return 0;
 	}
+
+	SYS_MutexLock(&usbNotifierMutex);
 
 	strncpy(readerTracker[i].bus_device, bus_device,
 		sizeof(readerTracker[i].bus_device));




More information about the Pcsclite-cvs-commit mailing list