From owner-p4-projects@FreeBSD.ORG Wed Feb 4 13:51:47 2009 Return-Path: Delivered-To: p4-projects@freebsd.org Received: by hub.freebsd.org (Postfix, from userid 32767) id 9F76A1065673; Wed, 4 Feb 2009 13:51:47 +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 5F16F106564A for ; Wed, 4 Feb 2009 13:51:47 +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 4D6428FC16 for ; Wed, 4 Feb 2009 13:51:47 +0000 (UTC) (envelope-from hselasky@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.14.3/8.14.3) with ESMTP id n14Dpkhg031471 for ; Wed, 4 Feb 2009 13:51:46 GMT (envelope-from hselasky@FreeBSD.org) Received: (from perforce@localhost) by repoman.freebsd.org (8.14.3/8.14.3/Submit) id n14Dpk3m031469 for perforce@freebsd.org; Wed, 4 Feb 2009 13:51:46 GMT (envelope-from hselasky@FreeBSD.org) Date: Wed, 4 Feb 2009 13:51:46 GMT Message-Id: <200902041351.n14Dpk3m031469@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 157137 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: Wed, 04 Feb 2009 13:51:48 -0000 http://perforce.freebsd.org/chv.cgi?CH=157137 Change 157137 by hselasky@hselasky_laptop001 on 2009/02/04 13:50:49 USB ethernet patch: - Make function definition match prototype. - Clear control request destination buffer in all error cases. Affected files ... .. //depot/projects/usb/src/sys/dev/usb2/ethernet/usb2_ethernet.c#9 edit Differences ... ==== //depot/projects/usb/src/sys/dev/usb2/ethernet/usb2_ethernet.c#9 (text+ko) ==== @@ -315,21 +315,25 @@ usb2_error_t usb2_ether_do_request(struct usb2_ether *ue, struct usb2_device_request *req, void *data, - uint32_t timeout) + unsigned int timeout) { uint16_t len; usb2_error_t err; + /* get request data length */ + len = UGETW(req->wLength); + /* check if the device is being detached */ - if (usb2_proc_is_gone(&ue->ue_tq)) - return (USB_ERR_IOERROR); + if (usb2_proc_is_gone(&ue->ue_tq)) { + err = USB_ERR_IOERROR; + goto done; + } - len = UGETW(req->wLength); - /* do the USB request */ err = usb2_do_request_flags(ue->ue_udev, ue->ue_mtx, req, data, 0, NULL, timeout); +done: /* on failure we zero the data */ if (err && len && (req->bmRequestType & UE_DIR_IN)) memset(data, 0, len);