diff options
author | Roel Kluin <roel.kluin@gmail.com> | 2009-05-22 16:46:52 +0800 |
---|---|---|
committer | Li Yang <leoli@freescale.com> | 2009-05-22 16:46:52 +0800 |
commit | f47edc6dab11801c2e97088ba7bbce042ded867c (patch) | |
tree | 99de3f248d23b997813ba0da149359601ed281e1 /drivers | |
parent | 0899d6349c60e4021224b51c8c97f49b829dfefd (diff) |
fsldma: fix check on potential fdev->chan[] overflow
Fix the check of potential array overflow when using corrupted channel
device tree nodes.
Signed-off-by: Roel Kluin <roel.kluin@gmail.com>
Signed-off-by: Li Yang <leoli@freescale.com>
Diffstat (limited to 'drivers')
-rw-r--r-- | drivers/dma/fsldma.c | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/dma/fsldma.c b/drivers/dma/fsldma.c index da8a8ed9e41..391b1bd7098 100644 --- a/drivers/dma/fsldma.c +++ b/drivers/dma/fsldma.c @@ -830,7 +830,7 @@ static int __devinit fsl_dma_chan_probe(struct fsl_dma_device *fdev, new_fsl_chan->reg.end - new_fsl_chan->reg.start + 1); new_fsl_chan->id = ((new_fsl_chan->reg.start - 0x100) & 0xfff) >> 7; - if (new_fsl_chan->id > FSL_DMA_MAX_CHANS_PER_DEVICE) { + if (new_fsl_chan->id >= FSL_DMA_MAX_CHANS_PER_DEVICE) { dev_err(fdev->dev, "There is no %d channel!\n", new_fsl_chan->id); err = -EINVAL; |