svn commit: r187165 - head/sys/dev/usb2/sound

Andrew Thompson thompsa at FreeBSD.org
Tue Jan 13 11:01:49 PST 2009


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 at 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;
 	}
 }


More information about the svn-src-head mailing list