[Pcsclite-cvs-commit] r5828 - /trunk/Drivers/ccid/src/parse.c

rousseau at users.alioth.debian.org rousseau at users.alioth.debian.org
Tue Jul 5 21:16:18 UTC 2011


Author: rousseau
Date: Tue Jul  5 21:16:18 2011
New Revision: 5828

URL: http://svn.debian.org/wsvn/pcsclite/?sc=1&rev=5828
Log:
Fix a UNREACHABLE coverity error

Code after the goto was dead code

Modified:
    trunk/Drivers/ccid/src/parse.c

Modified: trunk/Drivers/ccid/src/parse.c
URL: http://svn.debian.org/wsvn/pcsclite/trunk/Drivers/ccid/src/parse.c?rev=5828&op=diff
==============================================================================
--- trunk/Drivers/ccid/src/parse.c (original)
+++ trunk/Drivers/ccid/src/parse.c Tue Jul  5 21:16:18 2011
@@ -156,6 +156,7 @@
 		if (r < 0)
 		{
 			(void)fprintf(stderr, "  Can't get config descriptor: %d\n", r);
+			(void)libusb_close(handle);
 			continue;
 		}
 
@@ -170,6 +171,7 @@
 		}
 		if (!class_ff && (0xFF == usb_interface->altsetting->bInterfaceClass))
 		{
+			(void)libusb_close(handle);
 			(void)fprintf(stderr, MAGENTA "  Found a possibly CCID/ICCD device (bInterfaceClass = 0xFF). Use -p\n" NORMAL);
 			continue;
 		}
@@ -210,6 +212,7 @@
 
 		(void)ccid_parse_interface_descriptor(handle, desc, config_desc, num,
 			usb_interface);
+		nb++;
 
 #ifndef __APPLE__
 		(void)libusb_release_interface(handle, interface);
@@ -217,9 +220,6 @@
 		/* check for another CCID interface on the same device */
 		num++;
 		goto again;
-
-		(void)libusb_close(handle);
-		nb++;
 	}
 
 	if ((0 == nb) && (0 != geteuid()))




More information about the Pcsclite-cvs-commit mailing list