Skip to content

Commit

Permalink
dma/imx-sdma: use num_events to validate event_id0
Browse files Browse the repository at this point in the history
event number is not always 32. use num_events for checking instead.

Signed-off-by: Richard Zhao <richard.zhao@linaro.org>
Acked-by: Shawn Guo <shawn.guo@linaro.org>
Signed-off-by: Vinod Koul <vinod.koul@linux.intel.com>
  • Loading branch information
Richard Zhao authored and Vinod Koul committed Jan 31, 2012
1 parent c2c744d commit b78bd91
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion drivers/dma/imx-sdma.c
Original file line number Diff line number Diff line change
Expand Up @@ -723,7 +723,7 @@ static int sdma_config_channel(struct sdma_channel *sdmac)
sdmac->per_addr = 0;

if (sdmac->event_id0) {
if (sdmac->event_id0 > 32)
if (sdmac->event_id0 >= sdmac->sdma->num_events)
return -EINVAL;
sdma_event_enable(sdmac, sdmac->event_id0);
}
Expand Down

0 comments on commit b78bd91

Please sign in to comment.