Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit aa3ee5f5 authored by Axel Lin's avatar Axel Lin Committed by Vinod Koul
Browse files

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



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

Signed-off-by: default avatarAxel Lin <axel.lin@ingics.com>
Reviewed-by: default avatarJun Nie <jun.nie@linaro.org>
Signed-off-by: default avatarVinod Koul <vinod.koul@intel.com>
parent 0be2136b
Loading
Loading
Loading
Loading
+1 −1
Original line number Diff line number Diff line
@@ -739,7 +739,7 @@ static struct dma_chan *zx_of_dma_simple_xlate(struct of_phandle_args *dma_spec,
	struct dma_chan *chan;
	struct zx_dma_chan *c;

	if (request > d->dma_requests)
	if (request >= d->dma_requests)
		return NULL;

	chan = dma_get_any_slave_channel(&d->slave);