Patchwork pata_at91: call clk_put() on ata_host_activate() failure

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

Comments

Sergei Shtylyov - Oct. 10, 2011, 3:09 p.m.
pata_at91_probe() forgets to call clk_put() iff ata_host_activate() fails...

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

---
This patch is against the recent Linus' tree.

 drivers/ata/pata_at91.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

--
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/pata_at91.c
===================================================================
--- linux-2.6.orig/drivers/ata/pata_at91.c
+++ linux-2.6/drivers/ata/pata_at91.c
@@ -414,10 +414,13 @@  static int __devinit pata_at91_probe(str
 
 	host->private_data = info;
 
-	return ata_host_activate(host, irq ? gpio_to_irq(irq) : 0,
+	ret = ata_host_activate(host, irq ? gpio_to_irq(irq) : 0,
 			irq ? ata_sff_interrupt : NULL,
 			irq_flags, &pata_at91_sht);
 
+	if (!ret)
+		return 0;
+
 err_put:
 	clk_put(info->mck);
 	return ret;