[Pcsclite-git-commit] [CCID] 03/08: ccid_usb.c: improve close_libusb_if_needed()

Ludovic Rousseau rousseau at moszumanska.debian.org
Tue Apr 19 19:10:24 UTC 2016


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

rousseau pushed a commit to branch master
in repository CCID.

commit 57b93f4f553e3573b1e857df6c3429c7f017d5d0
Author: Ludovic Rousseau <ludovic.rousseau at free.fr>
Date:   Tue Apr 19 20:29:13 2016 +0200

    ccid_usb.c: improve close_libusb_if_needed()
    
    If the libusb context (ctx) is already NULL then no need to call
    libusb_exit().
    
    The idea is to be able to call close_libusb_if_needed() any time
    without checking the value of ctx first.
---
 src/ccid_usb.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/src/ccid_usb.c b/src/ccid_usb.c
index 4908a72..e08f219 100644
--- a/src/ccid_usb.c
+++ b/src/ccid_usb.c
@@ -174,6 +174,9 @@ static void close_libusb_if_needed(void)
 {
 	int i, to_exit = TRUE;
 
+	if (NULL == ctx)
+		return;
+
 	/* if at least 1 reader is still in use we do not exit libusb */
 	for (i=0; i<CCID_DRIVER_MAX_READERS; i++)
 	{

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



More information about the Pcsclite-cvs-commit mailing list