提交 0b851be2 编写于 作者: P Paul Zimmerman 提交者: 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: NDan Carpenter <dan.carpenter@oracle.com>
Signed-off-by: NPaul Zimmerman <paulz@synopsys.com>
Signed-off-by: NGreg Kroah-Hartman <gregkh@linuxfoundation.org>
上级 54216ace
......@@ -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;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册