From owner-cvs-src@FreeBSD.ORG Mon Nov 27 19:50:47 2006 Return-Path: X-Original-To: cvs-src@FreeBSD.org Delivered-To: cvs-src@FreeBSD.org Received: from mx1.FreeBSD.org (mx1.freebsd.org [69.147.83.52]) by hub.freebsd.org (Postfix) with ESMTP id 16BCE16A415; Mon, 27 Nov 2006 19:50:47 +0000 (UTC) (envelope-from marius@FreeBSD.org) Received: from repoman.freebsd.org (repoman.freebsd.org [69.147.83.41]) by mx1.FreeBSD.org (Postfix) with ESMTP id 1C6C64400E; Mon, 27 Nov 2006 18:38:46 +0000 (GMT) (envelope-from marius@FreeBSD.org) Received: from repoman.freebsd.org (localhost [127.0.0.1]) by repoman.freebsd.org (8.13.6/8.13.6) with ESMTP id kARId3Mp039748; Mon, 27 Nov 2006 18:39:03 GMT (envelope-from marius@repoman.freebsd.org) Received: (from marius@localhost) by repoman.freebsd.org (8.13.6/8.13.4/Submit) id kARId33k039747; Mon, 27 Nov 2006 18:39:03 GMT (envelope-from marius) Message-Id: <200611271839.kARId33k039747@repoman.freebsd.org> From: Marius Strobl Date: Mon, 27 Nov 2006 18:39:03 +0000 (UTC) To: src-committers@FreeBSD.org, cvs-src@FreeBSD.org, cvs-all@FreeBSD.org X-FreeBSD-CVS-Branch: HEAD Cc: Subject: cvs commit: src/sys/dev/usb usbdi.c X-BeenThere: cvs-src@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: CVS commit messages for the src tree List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 27 Nov 2006 19:50:47 -0000 marius 2006-11-27 18:39:03 UTC FreeBSD src repository Modified files: sys/dev/usb usbdi.c Log: Refine the previous change to only call bus_dmamap_sync() in case of an URQ_REQUEST when DMA segments are passed to usbd_start_transfer(); when the request doesn't include the optional data buffer the size of the transfer (xfer->length) is 0, in which case usbd_transfer() won't create a DMA map but call usbd_start_transfer() with no DMA segments. With the previous change this could result in the bus_dmamap_sync() implementation dereferencing the NULL-pointer passed as the DMA map argument. While at it fix what appears to be a typo in usbd_start_transfer(); in order to determine wheter usbd_start_transfer() was called with DMA segments check whether the number of segments is > 0 rather than the pointer to them being > 0. OK'ed by: imp Revision Changes Path 1.99 +19 -12 src/sys/dev/usb/usbdi.c