Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752341AbdHHKio (ORCPT ); Tue, 8 Aug 2017 06:38:44 -0400 Received: from mail-qk0-f169.google.com ([209.85.220.169]:35166 "EHLO mail-qk0-f169.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752319AbdHHKil (ORCPT ); Tue, 8 Aug 2017 06:38:41 -0400 MIME-Version: 1.0 In-Reply-To: <0d9fccf8e14a639274115cc43a97804ef059d8b1.1502171094.git.arvind.yadav.cs@gmail.com> References: <0d9fccf8e14a639274115cc43a97804ef059d8b1.1502171094.git.arvind.yadav.cs@gmail.com> From: Ulf Hansson Date: Tue, 8 Aug 2017 12:38:40 +0200 Message-ID: Subject: Re: [PATCH] mmc: wmt-sdmmc: Handle return value of clk_prepare_enable To: Arvind Yadav Cc: Tony Prisk , "linux-kernel@vger.kernel.org" , "linux-arm-kernel@lists.infradead.org" , "linux-mmc@vger.kernel.org" Content-Type: text/plain; charset="UTF-8" Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1194 Lines: 41 On 8 August 2017 at 07:46, Arvind Yadav wrote: > clk_prepare_enable() can fail here and we must check its return value. > > Signed-off-by: Arvind Yadav Thanks, applied for next! Kind regards Uffe > --- > drivers/mmc/host/wmt-sdmmc.c | 6 +++++- > 1 file changed, 5 insertions(+), 1 deletion(-) > > diff --git a/drivers/mmc/host/wmt-sdmmc.c b/drivers/mmc/host/wmt-sdmmc.c > index 21ebba8..e64f930 100644 > --- a/drivers/mmc/host/wmt-sdmmc.c > +++ b/drivers/mmc/host/wmt-sdmmc.c > @@ -856,7 +856,9 @@ static int wmt_mci_probe(struct platform_device *pdev) > goto fail5; > } > > - clk_prepare_enable(priv->clk_sdmmc); > + ret = clk_prepare_enable(priv->clk_sdmmc); > + if (ret) > + goto fail6; > > /* configure the controller to a known 'ready' state */ > wmt_reset_hardware(mmc); > @@ -866,6 +868,8 @@ static int wmt_mci_probe(struct platform_device *pdev) > dev_info(&pdev->dev, "WMT SDHC Controller initialized\n"); > > return 0; > +fail6: > + clk_put(priv->clk_sdmmc); > fail5: > free_irq(dma_irq, priv); > fail4: > -- > 1.9.1 >