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: Dan Carpenter <dan.carpenter@oracle.com> Signed-off-by: Paul Zimmerman <paulz@synopsys.com> Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
This commit is contained in:
parent
54216acee5
commit
0b851be273
|
@ -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];
|
||||
int len = chan->xfer_len;
|
||||
|
||||
if (len > MAX_DMA_DESC_SIZE)
|
||||
len = MAX_DMA_DESC_SIZE - chan->max_packet + 1;
|
||||
if (len > MAX_DMA_DESC_SIZE - (chan->max_packet - 1))
|
||||
len = MAX_DMA_DESC_SIZE - (chan->max_packet - 1);
|
||||
|
||||
if (chan->ep_is_in) {
|
||||
int num_packets;
|
||||
|
|
Loading…
Reference in New Issue