From owner-p4-projects@FreeBSD.ORG Fri Dec 28 17:12:17 2007 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 5750916A420; Fri, 28 Dec 2007 17:12:17 +0000 (UTC) Delivered-To: perforce@FreeBSD.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 1D5ED16A41A for ; Fri, 28 Dec 2007 17:12:17 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [IPv6:2001:4f8:fff6::29]) by mx1.freebsd.org (Postfix) with ESMTP id E7FCF13C45A for ; Fri, 28 Dec 2007 17:12:16 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.1/8.14.1) with ESMTP id lBSHCGhL080096 for ; Fri, 28 Dec 2007 17:12:16 GMT (envelope-from hselasky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.1/8.14.1/Submit) id lBSHCG8b080092 for perforce@freebsd.org; Fri, 28 Dec 2007 17:12:16 GMT (envelope-from hselasky@FreeBSD.org) Date: Fri, 28 Dec 2007 17:12:16 GMT Message-Id: <200712281712.lBSHCG8b080092@repoman.freebsd.org> X-Authentication-Warning: repoman.freebsd.org: perforce set sender to hselasky@FreeBSD.org using -f From: Hans Petter Selasky To: Perforce Change Reviews Cc: Subject: PERFORCE change 131881 for review X-BeenThere: p4-projects@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: p4 projects tree changes List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 28 Dec 2007 17:12:17 -0000 http://perforce.freebsd.org/chv.cgi?CH=131881 Change 131881 by hselasky@hselasky_laptop001 on 2007/12/28 17:11:49 Invalid actual length and actual frames can happen when we are cancelling an USB transfer. Only panic if this happens when the USB transfer is complete. Affected files ... .. //depot/projects/usb/src/sys/dev/usb/usb_transfer.c#95 edit Differences ... ==== //depot/projects/usb/src/sys/dev/usb/usb_transfer.c#95 (text+ko) ==== @@ -2674,12 +2674,14 @@ /* check actual number of frames */ if (xfer->aframes > xfer->nframes) { + if (error == 0) { panic("%s: actual number of frames, %d, is " "greater than initial number of frames, %d!\n", __FUNCTION__, xfer->aframes, xfer->nframes); - - /* XXX */ + } else { + /* just set some valid value */ xfer->aframes = xfer->nframes; + } } /* compute actual length */ xfer->actlen = 0; @@ -2699,11 +2701,14 @@ /* check actual length */ if (xfer->actlen > xfer->sumlen) { + if (error == 0) { panic("%s: actual length, %d, is greater than " "initial length, %d!\n", __FUNCTION__, xfer->actlen, xfer->sumlen); - /* XXX */ + } else { + /* just set some valid value */ xfer->actlen = xfer->sumlen; + } } PRINTFN(5, ("xfer=%p pipe=%p sts=%d alen=%d, slen=%d, afrm=%d, nfrm=%d\n", xfer, xfer->pipe, error, xfer->actlen, xfer->sumlen,