Skip site navigation (1)Skip section navigation (2)
Date:      Tue, 13 Jan 2009 19:01:46 +0000 (UTC)
From:      Andrew Thompson <thompsa@FreeBSD.org>
To:        src-committers@freebsd.org, svn-src-all@freebsd.org, svn-src-head@freebsd.org
Subject:   svn commit: r187165 - head/sys/dev/usb2/sound
Message-ID:  <200901131901.n0DJ1k0T012099@svn.freebsd.org>

next in thread | raw e-mail | index | archive | help
Author: thompsa
Date: Tue Jan 13 19:01:46 2009
New Revision: 187165
URL: http://svn.freebsd.org/changeset/base/187165

Log:
  MFp4: //depot/projects/usb@155754
  
  	Make sure that the cancelled error code
  	is always checked and result in a return
  	from the USB callback.
  
  Submitted by: Hans Petter Selasky

Modified:
  head/sys/dev/usb2/sound/uaudio2.c

Modified: head/sys/dev/usb2/sound/uaudio2.c
==============================================================================
--- head/sys/dev/usb2/sound/uaudio2.c	Tue Jan 13 19:01:35 2009	(r187164)
+++ head/sys/dev/usb2/sound/uaudio2.c	Tue Jan 13 19:01:46 2009	(r187165)
@@ -2921,6 +2921,8 @@ uaudio_mixer_write_cfg_callback(struct u
 	uint8_t chan;
 	uint8_t buf[2];
 
+	DPRINTF("\n");
+
 	switch (USB_GET_STATE(xfer)) {
 	case USB_ST_TRANSFERRED:
 tr_transferred:
@@ -2980,11 +2982,14 @@ tr_setup:
 		if (repeat) {
 			goto tr_setup;
 		}
-		return;
+		break;
 
 	default:			/* Error */
 		DPRINTF("error=%s\n", usb2_errstr(xfer->error));
-
+		if (xfer->error == USB_ERR_CANCELLED) {
+			/* do nothing - we are detaching */
+			break;
+		}
 		goto tr_transferred;
 	}
 }



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