summaryrefslogtreecommitdiffstats
path: root/drivers/dma/ste_dma40.c
diff options
context:
space:
mode:
authorDan Carpenter2013-08-23 11:23:43 +0200
committerVinod Koul2013-08-25 12:53:32 +0200
commit5be2190af4b03be5959684f7336c8da62606809e (patch)
tree64ed977ea37d45c39c52ad61ae60bab3f27825a3 /drivers/dma/ste_dma40.c
parentdma: ste_dma: Fix warning when CONFIG_ARM_LPAE=y (diff)
downloadkernel-qcow2-linux-5be2190af4b03be5959684f7336c8da62606809e.tar.gz
kernel-qcow2-linux-5be2190af4b03be5959684f7336c8da62606809e.tar.xz
kernel-qcow2-linux-5be2190af4b03be5959684f7336c8da62606809e.zip
dmaengine: ste_dma40: off by one in d40_of_probe()
If "num_disabled" is equal to STEDMA40_MAX_PHYS (32) then we would write one space beyond the end of the pdata->disable_channels[] array. Signed-off-by: Dan Carpenter <dan.carpenter@oracle.com> Acked-by: Linus Walleij <linus.walleij@linaro.org> Signed-off-by: Vinod Koul <vinod.koul@intel.com>
Diffstat (limited to 'drivers/dma/ste_dma40.c')
-rw-r--r--drivers/dma/ste_dma40.c2
1 files changed, 1 insertions, 1 deletions
diff --git a/drivers/dma/ste_dma40.c b/drivers/dma/ste_dma40.c
index 7c268b96e760..7bbcabbc282a 100644
--- a/drivers/dma/ste_dma40.c
+++ b/drivers/dma/ste_dma40.c
@@ -3516,7 +3516,7 @@ static int __init d40_of_probe(struct platform_device *pdev,
list = of_get_property(np, "disabled-channels", &num_disabled);
num_disabled /= sizeof(*list);
- if (num_disabled > STEDMA40_MAX_PHYS || num_disabled < 0) {
+ if (num_disabled >= STEDMA40_MAX_PHYS || num_disabled < 0) {
d40_err(&pdev->dev,
"Invalid number of disabled channels specified (%d)\n",
num_disabled);