dmaengine: ste_dma40: off by one in d40_of_probe()
Subsystems (3)
PATCH 1/1 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 <[email protected]>
drivers/dma/ste_dma40.c +1 -1
@@ -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);
Quoted 4 lines · Dan Carpenter
If "
num_disabled" is equal toSTEDMA40_MAX_PHYS(32) then we would write one space beyond the end of the pdata->disable_channels[] array.Signed-off-by Dan Carpenter <[email protected]>
Acked-by Linus Walleij <[email protected]>
Yours,
Linus Walleij
Vinod Koul
AppliedQuoted 2 lines · Dan Carpenter
If "
num_disabled" is equal toSTEDMA40_MAX_PHYS(32) then we would write one space beyond the end of the pdata->disable_channels[] array.
Applied, thanks
~Vinod