[ARM] s3c-fb: Fix an off-by-one error at window release

Started by Pawel Osciak on Jul 9, 2009

Subsystems (2)

Maintainers (2)

DORMANTno replies REVIEWED · 2 reviews, 2 by maintainers

Status: Reviewed.

2 review trailers.

open the first message on its own page

Message details and related content
    
This bug caused the release function being called on the first
uninitialized window, instead of starting with the last successfully
initialized one.    

Reviewed-by: Marek Szyprowski <m.szyprowski@samsung.com>
Reviewed-by: Kyungmin Park <kyungmin.park@samsung.com>
Signed-off-by: Pawel Osciak <redacted>


diff --git a/drivers/video/s3c-fb.c b/drivers/video/s3c-fb.c
index bb63c07..ff0b1a3 100644
--- a/drivers/video/s3c-fb.c
+++ b/drivers/video/s3c-fb.c
@@ -926,7 +926,7 @@ static int __devinit s3c_fb_probe(struct platform_device *pdev)
 		ret = s3c_fb_probe_win(sfb, win, &sfb->windows[win]);
 		if (ret < 0) {
 			dev_err(dev, "failed to create window %d\n", win);
-			for (; win >= 0; win--)
+			for ( win = win - 1; win >= 0; win--)
 				s3c_fb_release_win(sfb, sfb->windows[win]);
 			goto err_ioremap;
 		}

-------------------------------------------------------------------
List admin: http://lists.arm.linux.org.uk/mailman/listinfo/linux-arm-kernel
FAQ:        http://www.arm.linux.org.uk/mailinglists/faq.php
Etiquette:  http://www.arm.linux.org.uk/mailinglists/etiquette.php
Keyboard shortcuts
hback out one level
jnext message in thread / next series-diff position
kprevious message in thread / previous series-diff position
ldrill in
Escclose help / fold thread tree
?toggle this help