提交 947a2462 编写于 作者: R Ramax Lo 提交者: Ben Dooks

ARM: S3C24XX: DMA: Use valid index when accessing array

The DMA_CH_VALID bit used in the channel index should be masked out before
using it to access the channel array.
Signed-off-by: NRamax Lo <ramaxlo@gmail.com>
Signed-off-by: NBen Dooks <ben-linux@fluff.org>
上级 93b0d8c6
......@@ -1403,11 +1403,13 @@ static struct s3c2410_dma_chan *s3c2410_dma_map_channel(int channel)
ord = &dma_order->channels[channel];
for (ch = 0; ch < dma_channels; ch++) {
int tmp;
if (!is_channel_valid(ord->list[ch]))
continue;
if (s3c2410_chans[ord->list[ch]].in_use == 0) {
ch = ord->list[ch] & ~DMA_CH_VALID;
tmp = ord->list[ch] & ~DMA_CH_VALID;
if (s3c2410_chans[tmp].in_use == 0) {
ch = tmp;
goto found;
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册