PERFORCE change 155754 for review

Hans Petter Selasky hselasky at FreeBSD.org
Wed Jan 7 13:23:13 UTC 2009


http://perforce.freebsd.org/chv.cgi?CH=155754

Change 155754 by hselasky at hselasky_laptop001 on 2009/01/07 13:22:11

	
	Make sure that the cancelled error code
	is always checked and result in a return
	from the USB callback.

Affected files ...

.. //depot/projects/usb/src/sys/dev/usb2/sound/uaudio2.c#24 edit

Differences ...

==== //depot/projects/usb/src/sys/dev/usb2/sound/uaudio2.c#24 (text+ko) ====

@@ -2921,6 +2921,8 @@
 	uint8_t chan;
 	uint8_t buf[2];
 
+	DPRINTF("\n");
+
 	switch (USB_GET_STATE(xfer)) {
 	case USB_ST_TRANSFERRED:
 tr_transferred:
@@ -2980,11 +2982,14 @@
 		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 p4-projects mailing list