From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id F355F79C9 for ; Thu, 12 Jan 2023 14:22:36 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 5777EC433EF; Thu, 12 Jan 2023 14:22:36 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1673533356; bh=gxDd4f5LkgmMNJXfkpe3yvdT/dyR7zSd72jXU0hoj/Q=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=V3SnznCfiWZT72c4Qrc+/0UKYSBl4dcWp5680AvKE7aG/07VuugRSszXmFYbmnw15 m9HEBGjp+mRVocnk9MWgYey321dvHzAbGpxY1m9wtmfA3gaWBg5e/NT7K8IY1KDt/p aro69m1G9gzfuLG1o2iSqW1iAs9g/Hcul5vVr8+8= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Gaosheng Cui , Alexandre Belloni , Sasha Levin Subject: [PATCH 5.10 453/783] rtc: st-lpc: Add missing clk_disable_unprepare in st_rtc_probe() Date: Thu, 12 Jan 2023 14:52:49 +0100 Message-Id: <20230112135545.251921105@linuxfoundation.org> X-Mailer: git-send-email 2.39.0 In-Reply-To: <20230112135524.143670746@linuxfoundation.org> References: <20230112135524.143670746@linuxfoundation.org> User-Agent: quilt/0.67 Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit From: Gaosheng Cui [ Upstream commit 5fb733d7bd6949e90028efdce8bd528c6ab7cf1e ] The clk_disable_unprepare() should be called in the error handling of clk_get_rate(), fix it. Fixes: b5b2bdfc2893 ("rtc: st: Add new driver for ST's LPC RTC") Signed-off-by: Gaosheng Cui Link: https://lore.kernel.org/r/20221123014805.1993052-1-cuigaosheng1@huawei.com Signed-off-by: Alexandre Belloni Signed-off-by: Sasha Levin --- drivers/rtc/rtc-st-lpc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/rtc/rtc-st-lpc.c b/drivers/rtc/rtc-st-lpc.c index 0c65448b85ee..7d53f7e2febc 100644 --- a/drivers/rtc/rtc-st-lpc.c +++ b/drivers/rtc/rtc-st-lpc.c @@ -238,6 +238,7 @@ static int st_rtc_probe(struct platform_device *pdev) rtc->clkrate = clk_get_rate(rtc->clk); if (!rtc->clkrate) { + clk_disable_unprepare(rtc->clk); dev_err(&pdev->dev, "Unable to fetch clock rate\n"); return -EINVAL; } -- 2.35.1