Skip to contentSkip to conversation

s1d13xxxfb: Fix resource leak

PATCH In review Antonino A. Daplas 2 participants 2 messages Mar 11, 2006 Framebuffer layer

lore
Share & tools
lore
#0 lore raw

PATCH 7/18 s1d13xxxfb: Fix resource leak

struct info may not be released in the driver's error path.

Coverity Bug 672

---

 drivers/video/s1d13xxxfb.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
drivers/video/s1d13xxxfb.c +1 -2
index e5d0f92..feec47b 100644
@@ -588,6 +588,7 @@ s1d13xxxfb_probe(struct platform_device 
 		goto bail;
 	}
 
+	platform_set_drvdata(pdev, info);
 	default_par = info->par;
 	default_par->regs = ioremap_nocache(pdev->resource[1].start,
 			pdev->resource[1].end - pdev->resource[1].start +1);
@@ -638,8 +639,6 @@ s1d13xxxfb_probe(struct platform_device 
 		goto bail;
 	}
 
-	platform_set_drvdata(pdev, info);
-
 	printk(KERN_INFO "fb%d: %s frame buffer device\n",
 	       info->node, info->fix.id);
 

-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=110944&bid=241720&dat=121642

Acked-by on v1 7/18
#1 lore raw
Quoted 26 lines · Antonino A. Daplas

struct info may not be released in the driver's error path.

Coverity Bug 672

---

 drivers/video/s1d13xxxfb.c |    3 +--
 1 files changed, 1 insertions(+), 2 deletions(-)
drivers/video/s1d13xxxfb.c +1 -0
index e5d0f92..feec47b 100644
@@ -588,6 +588,7 @@ s1d13xxxfb_probe(struct platform_device
                goto bail;
        }
 
+       platform_set_drvdata(pdev, info);
        default_par = info->par;
        default_par->regs = ioremap_nocache(pdev->resource[1].start,
                        pdev->resource[1].end - pdev->resource[1].start +1);

drivers/video/s1d13xxxfb.c s1d13xxxfb_probe(struct platform_device · line 644

Quoted 8 lines
drivers/video/s1d13xxxfb.c +0 -2
@@ -638,8 +639,6 @@ s1d13xxxfb_probe(struct platform_device
                goto bail;
        }
 
-       platform_set_drvdata(pdev, info);
-
        printk(KERN_INFO "fb%d: %s frame buffer device\n",
               info->node, info->fix.id);
 

--
Thibaut VARENE
http://www.parisc-linux.org/~varenet/

-------------------------------------------------------
This SF.Net email is sponsored by xPML, a groundbreaking scripting language that extends applications into web and mobile media. Attend the live webcast and join the prime developer group breaking into this new coding territory!
http://sel.as-us.falkag.net/sel?cmd=lnk&kid0944&bid$1720&dat1642