[Pcsclite-git-commit] [PCSC] 02/02: linux hotplug: handle error in parsing drivers

Ludovic Rousseau rousseau at moszumanska.debian.org
Fri Mar 18 12:50:12 UTC 2016


This is an automated email from the git hooks/post-receive script.

rousseau pushed a commit to branch master
in repository PCSC.

commit 152746d73149dff6218667b83b053233f2d3d476
Author: Ludovic Rousseau <ludovic.rousseau at free.fr>
Date:   Fri Mar 18 13:43:58 2016 +0100

    linux hotplug: handle error in parsing drivers
    
    The error returned by HPReadBundleValues() was not checked in
    HPSearchHotPluggables().
    
    We now check that at least 1 driver has been found before starting the
    notification thread.
    
    Thanks to Maksim Ivanov for the bug report
    https://lists.alioth.debian.org/pipermail/pcsclite-muscle/Week-of-Mon-20160314/000550.html
---
 src/hotplug_linux.c | 9 ++++-----
 1 file changed, 4 insertions(+), 5 deletions(-)

diff --git a/src/hotplug_linux.c b/src/hotplug_linux.c
index c4fc9b9..bf69af8 100644
--- a/src/hotplug_linux.c
+++ b/src/hotplug_linux.c
@@ -225,7 +225,7 @@ end:
 	}
 
 	closedir(hpDir);
-	return 0;
+	return bundleSize;
 }
 
 static void HPEstablishUSBNotifications(void)
@@ -425,10 +425,9 @@ LONG HPSearchHotPluggables(void)
 			bundleTracker[i].deviceNumber[j].id = 0;
 	}
 
-	HPReadBundleValues();
-
-	ThreadCreate(&usbNotifyThread, THREAD_ATTR_DETACHED,
-		(PCSCLITE_THREAD_FUNCTION( )) HPEstablishUSBNotifications, 0);
+	if (HPReadBundleValues() > 0)
+		ThreadCreate(&usbNotifyThread, THREAD_ATTR_DETACHED,
+			(PCSCLITE_THREAD_FUNCTION( )) HPEstablishUSBNotifications, 0);
 
 	return 0;
 }

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pcsclite/PCSC.git



More information about the Pcsclite-cvs-commit mailing list