diff options
author | Julia Lawall <julia@diku.dk> | 2011-07-04 10:11:45 -0400 |
---|---|---|
committer | Paul Mundt <lethal@linux-sh.org> | 2011-07-13 03:49:37 -0400 |
commit | 945903c7a477784e796168ef87b5022241cb52b5 (patch) | |
tree | 25c77ed310b3fcacb81cfc7707749c45a60a145c /drivers/video/msm | |
parent | 8d86e5f91440aa56a5df516bf58fe3883552ad56 (diff) |
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: Julia Lawall <julia@diku.dk>
Signed-off-by: Paul Mundt <lethal@linux-sh.org>
Diffstat (limited to 'drivers/video/msm')
-rw-r--r-- | drivers/video/msm/mdp.c | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/drivers/video/msm/mdp.c b/drivers/video/msm/mdp.c index c3636d55a3c5..7e94ee3d2521 100644 --- a/drivers/video/msm/mdp.c +++ b/drivers/video/msm/mdp.c | |||
@@ -422,7 +422,8 @@ int mdp_probe(struct platform_device *pdev) | |||
422 | clk = clk_get(&pdev->dev, "mdp_clk"); | 422 | clk = clk_get(&pdev->dev, "mdp_clk"); |
423 | if (IS_ERR(clk)) { | 423 | if (IS_ERR(clk)) { |
424 | printk(KERN_INFO "mdp: failed to get mdp clk"); | 424 | printk(KERN_INFO "mdp: failed to get mdp clk"); |
425 | return PTR_ERR(clk); | 425 | ret = PTR_ERR(clk); |
426 | goto error_get_clk; | ||
426 | } | 427 | } |
427 | 428 | ||
428 | ret = request_irq(mdp->irq, mdp_isr, IRQF_DISABLED, "msm_mdp", mdp); | 429 | ret = request_irq(mdp->irq, mdp_isr, IRQF_DISABLED, "msm_mdp", mdp); |
@@ -496,6 +497,7 @@ int mdp_probe(struct platform_device *pdev) | |||
496 | error_device_register: | 497 | error_device_register: |
497 | free_irq(mdp->irq, mdp); | 498 | free_irq(mdp->irq, mdp); |
498 | error_request_irq: | 499 | error_request_irq: |
500 | error_get_clk: | ||
499 | iounmap(mdp->base); | 501 | iounmap(mdp->base); |
500 | error_get_irq: | 502 | error_get_irq: |
501 | error_ioremap: | 503 | error_ioremap: |