Commit 0b851be2 authored by Paul Zimmerman's avatar Paul Zimmerman Committed by Greg Kroah-Hartman

staging: dwc2: fix thinko in dwc2_fill_host_dma_desc()

The check against MAX_DMA_DESC_SIZE didn't make sense, fix it
Reported-by: default avatarDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: default avatarPaul Zimmerman <paulz@synopsys.com>
Signed-off-by: default avatarGreg Kroah-Hartman <gregkh@linuxfoundation.org>
parent 54216ace
...@@ -621,8 +621,8 @@ static void dwc2_fill_host_dma_desc(struct dwc2_hsotg *hsotg, ...@@ -621,8 +621,8 @@ static void dwc2_fill_host_dma_desc(struct dwc2_hsotg *hsotg,
struct dwc2_hcd_dma_desc *dma_desc = &qh->desc_list[n_desc]; struct dwc2_hcd_dma_desc *dma_desc = &qh->desc_list[n_desc];
int len = chan->xfer_len; int len = chan->xfer_len;
if (len > MAX_DMA_DESC_SIZE) if (len > MAX_DMA_DESC_SIZE - (chan->max_packet - 1))
len = MAX_DMA_DESC_SIZE - chan->max_packet + 1; len = MAX_DMA_DESC_SIZE - (chan->max_packet - 1);
if (chan->ep_is_in) { if (chan->ep_is_in) {
int num_packets; int num_packets;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment