RE: [PATCH 2/2] USB: musb-gadget: fix DMA length for OUT transfer

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



tom.leiming@xxxxxxxxx wrote:
> 
> From: Ming Lei <tom.leiming@xxxxxxxxx>
> 
> DMA length should not go beyond the availabe space of request buffer,
> so fix it.
> 
> Signed-off-by: Ming Lei <tom.leiming@xxxxxxxxx>
> Cc: Anand Gadiyar <gadiyar@xxxxxx>
> Cc: Mike Frysinger <vapier@xxxxxxxxxx>
> Cc: Sergei Shtylyov <sshtylyov@xxxxxxxxxxxxx>

There's a small typo in the description.

But for the patch itself,

Acked-by: Anand Gadiyar <gadiyar@xxxxxx>

> ---
>  drivers/usb/musb/musb_gadget.c |    5 +++--
>  1 files changed, 3 insertions(+), 2 deletions(-)
> 
> diff --git a/drivers/usb/musb/musb_gadget.c b/drivers/usb/musb/musb_gadget.c
> index c0dfec4..e898228 100644
> --- a/drivers/usb/musb/musb_gadget.c
> +++ b/drivers/usb/musb/musb_gadget.c
> @@ -662,10 +662,11 @@ static void rxstate(struct musb *musb, struct musb_request *req)
>  				if (request->actual < request->length) {
>  					int transfer_size = 0;
>  #ifdef USE_MODE1
> -					transfer_size = min(request->length,
> +					transfer_size = min(request->length - request->actual,
>  							channel->max_len);
>  #else
> -					transfer_size = len;
> +					transfer_size = min(request->length - request->actual,
> +							len);
>  #endif
>  					if (transfer_size <= musb_ep->packet_sz)
>  						musb_ep->dma->desired_mode = 0;
> -- 
> 1.6.2.5
> 
> --
To unsubscribe from this list: send the line "unsubscribe linux-usb" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Linux Media]     [Linux Input]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [Old Linux USB Devel Archive]

  Powered by Linux