From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1752297AbdB1MJc (ORCPT ); Tue, 28 Feb 2017 07:09:32 -0500 Received: from mga04.intel.com ([192.55.52.120]:41466 "EHLO mga04.intel.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1751625AbdB1MJ2 (ORCPT ); Tue, 28 Feb 2017 07:09:28 -0500 X-ExtLoop1: 1 X-IronPort-AV: E=Sophos;i="5.35,219,1484035200"; d="scan'208";a="1135961764" Subject: Re: [PATCH] mmc: sdhci-pxav2: add error handling of clk_prepare_enable() To: Alexey Khoroshilov , Ulf Hansson References: <1486767286-3361-1-git-send-email-khoroshilov@ispras.ru> Cc: linux-mmc@vger.kernel.org, linux-kernel@vger.kernel.org, ldv-project@linuxtesting.org, Jisheng Zhang From: Adrian Hunter Organization: Intel Finland Oy, Registered Address: PL 281, 00181 Helsinki, Business Identity Code: 0357606 - 4, Domiciled in Helsinki Message-ID: <4a7a61c9-fb1f-1c43-c018-af019576ccec@intel.com> Date: Tue, 28 Feb 2017 13:55:31 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:45.0) Gecko/20100101 Thunderbird/45.7.0 MIME-Version: 1.0 In-Reply-To: <1486767286-3361-1-git-send-email-khoroshilov@ispras.ru> Content-Type: text/plain; charset=windows-1252 Content-Transfer-Encoding: 7bit Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org On 11/02/17 00:54, Alexey Khoroshilov wrote: > There is no check if clk_prepare_enable() succeed in sdhci_pxav2_probe(). > > Found by Linux Driver Verification project (linuxtesting.org). > > Signed-off-by: Alexey Khoroshilov Acked-by: Adrian Hunter > --- > drivers/mmc/host/sdhci-pxav2.c | 7 ++++++- > 1 file changed, 6 insertions(+), 1 deletion(-) > > diff --git a/drivers/mmc/host/sdhci-pxav2.c b/drivers/mmc/host/sdhci-pxav2.c > index 347eae2d7b6a..80513f54e9d4 100644 > --- a/drivers/mmc/host/sdhci-pxav2.c > +++ b/drivers/mmc/host/sdhci-pxav2.c > @@ -185,7 +185,11 @@ static int sdhci_pxav2_probe(struct platform_device *pdev) > goto err_clk_get; > } > pltfm_host->clk = clk; > - clk_prepare_enable(clk); > + ret = clk_prepare_enable(clk); > + if (ret) { > + dev_err(&pdev->dev, "failed to enable io clock\n"); > + goto err_clk_enable; > + } > > host->quirks = SDHCI_QUIRK_BROKEN_ADMA > | SDHCI_QUIRK_BROKEN_TIMEOUT_VAL > @@ -228,6 +232,7 @@ static int sdhci_pxav2_probe(struct platform_device *pdev) > > err_add_host: > clk_disable_unprepare(clk); > +err_clk_enable: > clk_put(clk); > err_clk_get: > sdhci_pltfm_free(pdev); >