提交 945903c7 编写于 作者: J Julia Lawall 提交者: Paul Mundt

drivers/video/msm/mdp.c: adjust error handling code

Use the error handling code at the end of the function, rather than
returning directly.

The semantic match that finds this problem is as follows:
(http://coccinelle.lip6.fr/)

// <smpl>
@r@
identifier x;
@@

kfree(x)

@@
identifier r.x;
expression E1!=0,E2,E3,E4;
statement S;
@@

(
if (<+...x...+>) S
|
if (...) { ... when != kfree(x)
               when != if (...) { ... kfree(x); ... }
               when != x = E3
* return E1;
}
... when != x = E2
if (...) { ... when != x = E4
 kfree(x); ... return ...; }
)
// </smpl>
Signed-off-by: NJulia Lawall <julia@diku.dk>
Signed-off-by: NPaul Mundt <lethal@linux-sh.org>
上级 8d86e5f9
...@@ -422,7 +422,8 @@ int mdp_probe(struct platform_device *pdev) ...@@ -422,7 +422,8 @@ int mdp_probe(struct platform_device *pdev)
clk = clk_get(&pdev->dev, "mdp_clk"); clk = clk_get(&pdev->dev, "mdp_clk");
if (IS_ERR(clk)) { if (IS_ERR(clk)) {
printk(KERN_INFO "mdp: failed to get mdp clk"); printk(KERN_INFO "mdp: failed to get mdp clk");
return PTR_ERR(clk); ret = PTR_ERR(clk);
goto error_get_clk;
} }
ret = request_irq(mdp->irq, mdp_isr, IRQF_DISABLED, "msm_mdp", mdp); ret = request_irq(mdp->irq, mdp_isr, IRQF_DISABLED, "msm_mdp", mdp);
...@@ -496,6 +497,7 @@ int mdp_probe(struct platform_device *pdev) ...@@ -496,6 +497,7 @@ int mdp_probe(struct platform_device *pdev)
error_device_register: error_device_register:
free_irq(mdp->irq, mdp); free_irq(mdp->irq, mdp);
error_request_irq: error_request_irq:
error_get_clk:
iounmap(mdp->base); iounmap(mdp->base);
error_get_irq: error_get_irq:
error_ioremap: error_ioremap:
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册