Skip to content

Commit

Permalink
dmaengine: zxdma: Fix off-by-one for testing valid pchan request
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Axel Lin authored and Vinod Koul committed Oct 1, 2015
1 parent 0be2136 commit aa3ee5f
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/dma/zx296702_dma.c
Original file line number Diff line number Diff line change
Expand Up @@ -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);
Expand Down

0 comments on commit aa3ee5f

Please sign in to comment.