Skip to contentSkip to conversation

sound/soc/nuc900/nuc900-ac97.c: add missing clk_put

PATCH Applied Julia Lawall 3 participants 3 messages Jun 1, 2011

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 2/10 sound/soc/nuc900/nuc900-ac97.c: add missing clk_put

From: Julia Lawall <[email protected]>

This goto is after the call to clk_get, so it should go to the label that includes a call to clk_put.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@r exists@
expression e1,e2;
statement S;
@@

e1 = clk_get@p1(...);
... when != e1 = e2

    when != clk_put(e1)
    when any
if (...) { ... when != clk_put(e1)
               when != if (...) { ... clk_put(e1) ... }

* return@p3 ...;
} else S
// </smpl>

---
 sound/soc/nuc900/nuc900-ac97.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/nuc900/nuc900-ac97.c +1 -1
index dac6732..9c0edad 100644
@@ -356,7 +356,7 @@ static int __devinit nuc900_ac97_drvprobe(struct platform_device *pdev)
 	nuc900_audio->irq_num = platform_get_irq(pdev, 0);
 	if (!nuc900_audio->irq_num) {
 		ret = -EBUSY;
-		goto out2;
+		goto out3;
 	}
 
 	nuc900_ac97_data = nuc900_audio;
Acked-by on v1 2/10
#1 lore raw
Quoted 36 lines · Julia Lawall

From: Julia Lawall <[email protected]>

This goto is after the call to clk_get, so it should go to the label that includes a call to clk_put.

A simplified version of the semantic match that finds this problem is as
follows: (http://coccinelle.lip6.fr/)

// <smpl>
@r exists@
expression e1,e2;
statement S;
@@

e1 = clk_get@p1(...);
... when != e1 = e2

    when != clk_put(e1)
    when any
if (...) { ... when != clk_put(e1)
               when != if (...) { ... clk_put(e1) ... }

* return@p3 ...;
} else S
// </smpl>

---
 sound/soc/nuc900/nuc900-ac97.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
sound/soc/nuc900/nuc900-ac97.c +0 -0
index dac6732..9c0edad 100644

sound/soc/nuc900/nuc900-ac97.c static int __devinit nuc900_ac97_drvprobe(struct platform_device *pdev) · line 362

Quoted 8 lines
sound/soc/nuc900/nuc900-ac97.c +1 -1
@@ -356,7 +356,7 @@ static int __devinit nuc900_ac97_drvprobe(struct platform_device *pdev)
 	nuc900_audio->irq_num = platform_get_irq(pdev, 0);
 	if (!nuc900_audio->irq_num) {
 		ret = -EBUSY;
-		goto out2;
+		goto out3;
 	}
 
 	nuc900_ac97_data = nuc900_audio;
Applied
#2 lore raw
In reply to Julia Lawall
Quoted 4 lines · Julia Lawall

From: Julia Lawall <[email protected]>

This goto is after the call to clk_get, so it should go to the label that includes a call to clk_put.

Applied, thanks. Please do try to use subject lines for your patches consistent with the code you're submitting against.