diff options
author | Julia Lawall <julia@diku.dk> | 2011-06-01 13:10:06 -0400 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@suse.de> | 2011-06-07 12:07:47 -0400 |
commit | 7febe2be36035e5c75128e8cc3baeb1f30fa2bc4 (patch) | |
tree | be07b9ecfc6de82b12f07d293eade844fbd0659f /drivers/usb | |
parent | 97b2f900335befbf6c4323ea6fd560ea5df4d154 (diff) |
drivers/usb/host/ohci-pxa27x.c: add missing clk_put
Add a label before the call to clk_put and jump to that in the error
handling code that occurs after the call to clk_get has succeeded.
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>
Signed-off-by: Julia Lawall <julia@diku.dk>
Acked-by: Eric Miao <eric.y.miao@gmail.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@suse.de>
Diffstat (limited to 'drivers/usb')
-rw-r--r-- | drivers/usb/host/ohci-pxa27x.c | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/usb/host/ohci-pxa27x.c b/drivers/usb/host/ohci-pxa27x.c index afef7b0a4195..80be5472783a 100644 --- a/drivers/usb/host/ohci-pxa27x.c +++ b/drivers/usb/host/ohci-pxa27x.c | |||
@@ -312,8 +312,10 @@ int usb_hcd_pxa27x_probe (const struct hc_driver *driver, struct platform_device | |||
312 | return PTR_ERR(usb_clk); | 312 | return PTR_ERR(usb_clk); |
313 | 313 | ||
314 | hcd = usb_create_hcd (driver, &pdev->dev, "pxa27x"); | 314 | hcd = usb_create_hcd (driver, &pdev->dev, "pxa27x"); |
315 | if (!hcd) | 315 | if (!hcd) { |
316 | return -ENOMEM; | 316 | retval = -ENOMEM; |
317 | goto err0; | ||
318 | } | ||
317 | 319 | ||
318 | r = platform_get_resource(pdev, IORESOURCE_MEM, 0); | 320 | r = platform_get_resource(pdev, IORESOURCE_MEM, 0); |
319 | if (!r) { | 321 | if (!r) { |
@@ -368,6 +370,7 @@ int usb_hcd_pxa27x_probe (const struct hc_driver *driver, struct platform_device | |||
368 | release_mem_region(hcd->rsrc_start, hcd->rsrc_len); | 370 | release_mem_region(hcd->rsrc_start, hcd->rsrc_len); |
369 | err1: | 371 | err1: |
370 | usb_put_hcd(hcd); | 372 | usb_put_hcd(hcd); |
373 | err0: | ||
371 | clk_put(usb_clk); | 374 | clk_put(usb_clk); |
372 | return retval; | 375 | return retval; |
373 | } | 376 | } |