lists.openwall.net   lists  /  announce  owl-users  owl-dev  john-users  john-dev  passwdqc-users  yescrypt  popa3d-users  /  oss-security  kernel-hardening  musl  sabotage  tlsify  passwords  /  crypt-dev  xvendor  /  Bugtraq  Full-Disclosure  linux-kernel  linux-netdev  linux-ext4  linux-hardening  linux-cve-announce  PHC 
Open Source and information security mailing list archives
 
Hash Suite: Windows password security audit tool. GUI, reports in PDF.
[<prev] [next>] [<thread-prev] [thread-next>] [day] [month] [year] [list]
Message-ID: <20130315143023.GB23930@arwen.pp.htv.fi>
Date:	Fri, 15 Mar 2013 16:30:24 +0200
From:	Felipe Balbi <balbi@...com>
To:	Kishon Vijay Abraham I <kishon@...com>
CC:	<balbi@...com>, <gregkh@...uxfoundation.org>,
	<linux-usb@...r.kernel.org>, <linux-omap@...r.kernel.org>,
	<linux-kernel@...r.kernel.org>, <tony@...mide.com>,
	<notasas@...il.com>
Subject: Re: [PATCH 2/4] usb: musb: gadget: do *unmap_dma_buffer* only for
 valid DMA addr

On Fri, Mar 15, 2013 at 06:58:50PM +0530, Kishon Vijay Abraham I wrote:
> musb does not use DMA buffer for ep0 but it uses the same giveback
> function *musb_g_giveback* for all endpoints (*musb_g_ep0_giveback* calls
> *musb_g_giveback*). So for ep0 case request.dma will be '0'
> and will result in kernel OOPS if tried to *unmap_dma_buffer* for requests in
> ep0. Fixed it by doing *unmap_dma_buffer* only for valid DMA addr.
> 
> Signed-off-by: Kishon Vijay Abraham I <kishon@...com>
> ---
>  drivers/usb/musb/musb_gadget.c |    5 ++++-
>  1 file changed, 4 insertions(+), 1 deletion(-)
> 
> diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c
> index c454375..ec3cf29 100644
> --- a/drivers/usb/musb/musb_gadget.c
> +++ b/drivers/usb/musb/musb_gadget.c
> @@ -107,7 +107,10 @@ __acquires(ep->musb->lock)
>  
>  	ep->busy = 1;
>  	spin_unlock(&musb->lock);
> -	unmap_dma_buffer(req, musb);
> +
> +	if (request->dma)

I have changed to if (!dma_mapping_error(request->dma)), is it alright ?

-- 
balbi

Download attachment "signature.asc" of type "application/pgp-signature" (837 bytes)

Powered by blists - more mailing lists

Powered by Openwall GNU/*/Linux Powered by OpenVZ