From patchwork Tue Sep 29 11:01:47 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 291059 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-13.5 required=3.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED, USER_AGENT_GIT autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 37467C4741F for ; Tue, 29 Sep 2020 11:52:00 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id E9BEE2065C for ; Tue, 29 Sep 2020 11:51:59 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601380320; bh=E+h+4T8t9gvH2CklFUCUtEYdfN0kaDKomiSDEuZ1QaY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:List-ID:From; b=BaY+ztx1nq6Wl0+AZ8O1P4xytUtK7qHIWcyWdZS9oTL70qKmYGM6tyKPrRL0oFkc5 741YsleVJWI++FZSOG3XfT3KBqA/m38tS82wpBI+2zCqn09olcexoM9fNogkJZFaG8 JeAkVBO1AOHwU1lIhGEz9NpFYV7rtU3ekcqVp/0o= Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1731088AbgI2Lvx (ORCPT ); Tue, 29 Sep 2020 07:51:53 -0400 Received: from mail.kernel.org ([198.145.29.99]:50252 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1731093AbgI2LsL (ORCPT ); Tue, 29 Sep 2020 07:48:11 -0400 Received: from localhost (83-86-74-64.cable.dynamic.v4.ziggo.nl [83.86.74.64]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by mail.kernel.org (Postfix) with ESMTPSA id 0C8BC2074A; Tue, 29 Sep 2020 11:48:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=default; t=1601380091; bh=E+h+4T8t9gvH2CklFUCUtEYdfN0kaDKomiSDEuZ1QaY=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=So1/gJ6QWxNBQOVTgJ18nTARX0skk7fo4S2tA0RD2NeIjmgmE1fqULum08u1Tzarv oMjRmDFxrJfE3/0eD2BY1AIOZaJNMfY44gDw5O6DN3VGszH4wsOyV1KLIlukY5g5Ui Nox+7yxo3GSscjP0MDB4pKPU5U8djRKHykidDRjM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Dan Carpenter , Dmitry Osipenko , Chanwoo Choi , Sasha Levin Subject: [PATCH 5.8 64/99] PM / devfreq: tegra30: Disable clock on error in probe Date: Tue, 29 Sep 2020 13:01:47 +0200 Message-Id: <20200929105932.880194205@linuxfoundation.org> X-Mailer: git-send-email 2.28.0 In-Reply-To: <20200929105929.719230296@linuxfoundation.org> References: <20200929105929.719230296@linuxfoundation.org> User-Agent: quilt/0.66 MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: stable@vger.kernel.org From: Dan Carpenter [ Upstream commit 6bf560766a8ef5afe4faa3244220cf5b3a934549 ] This error path needs to call clk_disable_unprepare(). Fixes: 7296443b900e ("PM / devfreq: tegra30: Handle possible round-rate error") Signed-off-by: Dan Carpenter Reviewed-by: Dmitry Osipenko Signed-off-by: Dan Carpenter Signed-off-by: Chanwoo Choi Signed-off-by: Sasha Levin --- drivers/devfreq/tegra30-devfreq.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/drivers/devfreq/tegra30-devfreq.c b/drivers/devfreq/tegra30-devfreq.c index e94a27804c209..dedd39de73675 100644 --- a/drivers/devfreq/tegra30-devfreq.c +++ b/drivers/devfreq/tegra30-devfreq.c @@ -836,7 +836,8 @@ static int tegra_devfreq_probe(struct platform_device *pdev) rate = clk_round_rate(tegra->emc_clock, ULONG_MAX); if (rate < 0) { dev_err(&pdev->dev, "Failed to round clock rate: %ld\n", rate); - return rate; + err = rate; + goto disable_clk; } tegra->max_freq = rate / KHZ; @@ -897,6 +898,7 @@ static int tegra_devfreq_probe(struct platform_device *pdev) dev_pm_opp_remove_all_dynamic(&pdev->dev); reset_control_reset(tegra->reset); +disable_clk: clk_disable_unprepare(tegra->clock); return err;