PERFORCE change 131613 for review

Hans Petter Selasky hselasky at FreeBSD.org
Tue Dec 25 12:29:12 PST 2007


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

Change 131613 by hselasky at hselasky_laptop001 on 2007/12/25 20:29:08

	
	Make the "usbd_clear_stall_callback()" NULL safe.
	Also add a line that clears the "stall_pipe" flag
	automatically when using the "usbd_clear_stall_callback()".

Affected files ...

.. //depot/projects/usb/src/sys/dev/usb/usb_transfer.c#89 edit

Differences ...

==== //depot/projects/usb/src/sys/dev/usb/usb_transfer.c#89 (text+ko) ====

@@ -3698,6 +3698,8 @@
  *  xfer1: Clear Stall Control Transfer
  *  xfer2: Stalled USB Transfer
  *
+ * This function is NULL safe.
+ *
  * Return values:
  *   0: In progress
  *   Else: Finished
@@ -3708,6 +3710,11 @@
 {
 	usb_device_request_t req;
 
+	if (xfer2 == NULL) {
+		/* looks like we are tearing down */
+		PRINTFN(0, ("NULL input parameter\n"));
+		return (0);
+	}
 	mtx_assert(xfer1->priv_mtx, MA_OWNED);
 	mtx_assert(xfer2->priv_mtx, MA_OWNED);
 
@@ -3756,6 +3763,9 @@
 		}
 		break;
 	}
+
+	xfer2->flags.stall_pipe = 0;	/* stop stalling the pipe */
+
 	return (1);			/* Clear Stall Finished */
 }
 


More information about the p4-projects mailing list