Date: Tue, 25 Dec 2007 20:29:10 GMT From: Hans Petter Selasky <hselasky@FreeBSD.org> To: Perforce Change Reviews <perforce@FreeBSD.org> Subject: PERFORCE change 131613 for review Message-ID: <200712252029.lBPKTACB038843@repoman.freebsd.org>
next in thread | raw e-mail | index | archive | help
http://perforce.freebsd.org/chv.cgi?CH=131613 Change 131613 by hselasky@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 */ }
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?200712252029.lBPKTACB038843>