Patchwork [1/2] sata_mv: release clock on ata_host_activate() failure

login
register
mail settings
Submitter Sergei Shtylyov
Date Oct. 7, 2011, 3:22 p.m.
Message ID <201110071922.33410.sshtylyov@ru.mvista.com>
Download mbox | patch
Permalink /patch/118333/
State Not Applicable
Delegated to: David Miller
Headers show

Comments

Sergei Shtylyov - Oct. 7, 2011, 3:22 p.m.
mv_platfrom_probe() forgets to call clk_disable() and clk_put() iff
ata_host_activate() fails...

Signed-off-by: Sergei Shtylyov <sshtylyov@ru.mvista.com>

---

 drivers/ata/sata_mv.c |    7 +++++--
 1 file changed, 5 insertions(+), 2 deletions(-)

--
To unsubscribe from this list: send the line "unsubscribe linux-ide" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

Index: linux-2.6/drivers/ata/sata_mv.c
===================================================================
--- linux-2.6.orig/drivers/ata/sata_mv.c
+++ linux-2.6/drivers/ata/sata_mv.c
@@ -4087,8 +4087,11 @@  static int mv_platform_probe(struct plat
 	dev_info(&pdev->dev, "slots %u ports %d\n",
 		 (unsigned)MV_MAX_Q_DEPTH, host->n_ports);
 
-	return ata_host_activate(host, platform_get_irq(pdev, 0), mv_interrupt,
-				 IRQF_SHARED, &mv6_sht);
+	rc = ata_host_activate(host, platform_get_irq(pdev, 0), mv_interrupt,
+			       IRQF_SHARED, &mv6_sht);
+	if (!rc)
+		return 0;
+
 err:
 #if defined(CONFIG_HAVE_CLK)
 	if (!IS_ERR(hpriv->clk)) {