summaryrefslogtreecommitdiffstats
path: root/drivers/video
diff options
context:
space:
mode:
authorTimur Tabi <timur@freescale.com>2011-09-15 23:44:56 +0200
committerFlorian Tobias Schandinat <FlorianSchandinat@gmx.de>2011-09-18 22:08:57 +0200
commit3f78bbd1a256e04dfb486dbee0430e0ecad6d960 (patch)
tree7e9846f54d59389f0a8afb4c331ae81ce14c6a88 /drivers/video
parentdrivers/video: fsl-diu-fb: fix memory leak on error (diff)
downloadlinux-3f78bbd1a256e04dfb486dbee0430e0ecad6d960.tar.xz
linux-3f78bbd1a256e04dfb486dbee0430e0ecad6d960.zip
drivers/video: fsl-diu-fb: use a normal for-loop to uninstall framebuffers
Uninstalling the framebuffers in reverse order is unnecessary and makes the for-loop awkward. Signed-off-by: Timur Tabi <timur@freescale.com> Signed-off-by: Florian Tobias Schandinat <FlorianSchandinat@gmx.de>
Diffstat (limited to 'drivers/video')
-rw-r--r--drivers/video/fsl-diu-fb.c10
1 files changed, 5 insertions, 5 deletions
diff --git a/drivers/video/fsl-diu-fb.c b/drivers/video/fsl-diu-fb.c
index c66f6ed57886..5137fbb6295f 100644
--- a/drivers/video/fsl-diu-fb.c
+++ b/drivers/video/fsl-diu-fb.c
@@ -1543,9 +1543,9 @@ static int __devinit fsl_diu_probe(struct platform_device *pdev)
return 0;
error:
- for (i = ARRAY_SIZE(machine_data->fsl_diu_info);
- i > 0; i--)
- uninstall_fb(machine_data->fsl_diu_info[i - 1]);
+ for (i = 0; i < ARRAY_SIZE(machine_data->fsl_diu_info); i++)
+ uninstall_fb(machine_data->fsl_diu_info[i]);
+
if (pool.ad.vaddr)
free_buf(&pdev->dev, &pool.ad,
sizeof(struct diu_ad) * FSL_AOI_NUM, 8);
@@ -1575,8 +1575,8 @@ static int fsl_diu_remove(struct platform_device *pdev)
machine_data = dev_get_drvdata(&pdev->dev);
disable_lcdc(machine_data->fsl_diu_info[0]);
free_irq_local(machine_data->irq);
- for (i = ARRAY_SIZE(machine_data->fsl_diu_info); i > 0; i--)
- uninstall_fb(machine_data->fsl_diu_info[i - 1]);
+ for (i = 0; i < ARRAY_SIZE(machine_data->fsl_diu_info); i++)
+ uninstall_fb(machine_data->fsl_diu_info[i]);
if (pool.ad.vaddr)
free_buf(&pdev->dev, &pool.ad,
sizeof(struct diu_ad) * FSL_AOI_NUM, 8);