فهرست منبع

dmaengine: zxdma: Fix off-by-one for testing valid pchan request

The valid pchan range is 0 ~ d->dma_requests - 1.

Signed-off-by: Axel Lin <axel.lin@ingics.com>
Reviewed-by: Jun Nie <jun.nie@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Axel Lin 10 سال پیش
والد
کامیت
aa3ee5f569
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      drivers/dma/zx296702_dma.c

+ 1 - 1
drivers/dma/zx296702_dma.c

@@ -739,7 +739,7 @@ static struct dma_chan *zx_of_dma_simple_xlate(struct of_phandle_args *dma_spec,
 	struct dma_chan *chan;
 	struct dma_chan *chan;
 	struct zx_dma_chan *c;
 	struct zx_dma_chan *c;
 
 
-	if (request > d->dma_requests)
+	if (request >= d->dma_requests)
 		return NULL;
 		return NULL;
 
 
 	chan = dma_get_any_slave_channel(&d->slave);
 	chan = dma_get_any_slave_channel(&d->slave);