Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.kernel > #1725645
| Path | csiph.com!news.mixmin.net!aioe.org!bofh.it!news.nic.it!robomod |
|---|---|
| From | Christophe JAILLET <christophe.jaillet@wanadoo.fr> |
| Newsgroups | linux.kernel |
| Subject | [PATCH] mtd: nand: lpc32xx_mlc: Fix an error handling path in lpc32xx_nand_probe() |
| Date | Sun, 03 Sep 2017 14:10:02 +0200 |
| Message-ID | <ulBSW-8e7-7@gated-at.bofh.it> (permalink) |
| X-Me-Helo | localhost.localdomain |
| X-Me-Auth | Y2hyaXN0b3BoZS5qYWlsbGV0QHdhbmFkb28uZnI= |
| X-Me-Date | Sun, 03 Sep 2017 14:00:12 +0200 |
| X-Me-IP | 86.196.182.67 |
| X-Mailer | git-send-email 2.11.0 |
| Sender | robomod@news.nic.it |
| List-ID | <linux-kernel.vger.kernel.org> |
| X-Mailing-List | linux-kernel@vger.kernel.org |
| Approved | robomod@news.nic.it |
| Lines | 34 |
| Organization | linux.* mail to news gateway |
| X-Original-Cc | linux-mtd@lists.infradead.org, linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org, kernel-janitors@vger.kernel.org, Christophe JAILLET <christophe.jaillet@wanadoo.fr> |
| X-Original-Date | Sun, 3 Sep 2017 13:58:31 +0200 |
| X-Original-Message-ID | <20170903115831.1326-1-christophe.jaillet@wanadoo.fr> |
| X-Original-Sender | linux-kernel-owner@vger.kernel.org |
| Xref | csiph.com linux.kernel:1725645 |
Show key headers only | View raw
If 'clk_prepare_enable()' fails, we must 'put' the corresponding clock.
Fixes: 4d26f012ab59 ("mtd: nand: lpc32xx_mlc: Handle return value of clk_prepare_enable.")
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
---
Labels in the error handling path could be renamed, but it does not worth
the effort, IMHO.
---
drivers/mtd/nand/lpc32xx_mlc.c | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/drivers/mtd/nand/lpc32xx_mlc.c b/drivers/mtd/nand/lpc32xx_mlc.c
index c3bb358ef01e..5f72a824e67d 100644
--- a/drivers/mtd/nand/lpc32xx_mlc.c
+++ b/drivers/mtd/nand/lpc32xx_mlc.c
@@ -707,7 +707,7 @@ static int lpc32xx_nand_probe(struct platform_device *pdev)
}
res = clk_prepare_enable(host->clk);
if (res)
- goto err_exit1;
+ goto err_put_clk;
nand_chip->cmd_ctrl = lpc32xx_nand_cmd_ctrl;
nand_chip->dev_ready = lpc32xx_nand_device_ready;
@@ -814,6 +814,7 @@ static int lpc32xx_nand_probe(struct platform_device *pdev)
dma_release_channel(host->dma_chan);
err_exit2:
clk_disable_unprepare(host->clk);
+err_put_clk:
clk_put(host->clk);
err_exit1:
lpc32xx_wp_enable(host);
--
2.11.0
Back to linux.kernel | Previous | Next | Find similar | Unroll thread
[PATCH] mtd: nand: lpc32xx_mlc: Fix an error handling path in lpc32xx_nand_probe() Christophe JAILLET <christophe.jaillet@wanadoo.fr> - 2017-09-03 14:10 +0200
csiph-web