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:
Paul Zimmerman 2013-11-25 13:42:45 -08:00 коммит произвёл Greg Kroah-Hartman
Родитель 54216acee5
Коммит 0b851be273
1 изменённых файлов: 2 добавлений и 2 удалений

Просмотреть файл

@ -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;