Skip site navigation (1)Skip section navigation (2)
Date:      Sat, 3 Dec 2011 16:19:08 +0000 (UTC)
From:      Hans Petter Selasky <hselasky@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r228235 - head/lib/libusb
Message-ID:  <201112031619.pB3GJ82B047101@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: hselasky
Date: Sat Dec  3 16:19:07 2011
New Revision: 228235
URL: http://svn.freebsd.org/changeset/base/228235

Log:
  libusb_open() sets the given device handle to NULL if it
  fails, so there is no need to do it again after returning.
  
  Submitted by:	Christoph Mallon
  MFC after:	3 days

Modified:
  head/lib/libusb/libusb10.c

Modified: head/lib/libusb/libusb10.c
==============================================================================
--- head/lib/libusb/libusb10.c	Sat Dec  3 15:51:15 2011	(r228234)
+++ head/lib/libusb/libusb10.c	Sat Dec  3 16:19:07 2011	(r228235)
@@ -427,8 +427,7 @@ libusb_open_device_with_vid_pid(libusb_c
 		 */
 		if (pdesc->idVendor == vendor_id &&
 		    pdesc->idProduct == product_id) {
-			if (libusb_open(devs[j], &pdev) < 0)
-				pdev = NULL;
+			libusb_open(devs[j], &pdev);
 			break;
 		}
 	}



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?201112031619.pB3GJ82B047101>