From nobody Wed Sep 3 06:44:33 2025 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by smtp.lore.kernel.org (Postfix) with ESMTP id DDD13FA3746 for ; Mon, 24 Oct 2022 12:31:04 +0000 (UTC) Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232157AbiJXMam (ORCPT ); Mon, 24 Oct 2022 08:30:42 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:48924 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233846AbiJXM2Z (ORCPT ); Mon, 24 Oct 2022 08:28:25 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [IPv6:2604:1380:4601:e00::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 157617656B; Mon, 24 Oct 2022 05:02:07 -0700 (PDT) Received: from smtp.kernel.org (relay.kernel.org [52.25.139.140]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ams.source.kernel.org (Postfix) with ESMTPS id ECD45B810DB; Mon, 24 Oct 2022 11:57:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4C8EDC433C1; Mon, 24 Oct 2022 11:57:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666612674; bh=yXMCTS8eONU++mGlDljHj3JlkYoORL7wIFX0W3Arlcs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tdlsy5qfHfI8Wgiw77L9rac5tL7dCUaOGgpbdL8naoYhfdqeUJcZG0NpCAndzeE+p wXgD6Xks30kCfW2LRe5P7uqDL8n8fYSJxWLv2V9RJERJZ5X2V2GCuyzpUHsV5YRwVV xuG4I/N83L1rxIv8uQ7dTlSgfcUz0Jn9nu4nYN0A= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Xu Qiang , Mark Brown , Sasha Levin Subject: [PATCH 4.19 076/229] spi: qup: add missing clk_disable_unprepare on error in spi_qup_resume() Date: Mon, 24 Oct 2022 13:29:55 +0200 Message-Id: <20221024113001.532215271@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024112959.085534368@linuxfoundation.org> References: <20221024112959.085534368@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: quoted-printable Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Xu Qiang [ Upstream commit 70034320fdc597b8f58b4a43bb547f17c4c5557a ] Add the missing clk_disable_unprepare() before return from spi_qup_resume() in the error handling case. Fixes: 64ff247a978f (=E2=80=9Cspi: Add Qualcomm QUP SPI controller support= =E2=80=9D) Signed-off-by: Xu Qiang Link: https://lore.kernel.org/r/20220825065324.68446-1-xuqiang36@huawei.com Signed-off-by: Mark Brown Signed-off-by: Sasha Levin --- drivers/spi/spi-qup.c | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) diff --git a/drivers/spi/spi-qup.c b/drivers/spi/spi-qup.c index cb74fd1af205..c5c727274814 100644 --- a/drivers/spi/spi-qup.c +++ b/drivers/spi/spi-qup.c @@ -1219,14 +1219,25 @@ static int spi_qup_resume(struct device *device) return ret; =20 ret =3D clk_prepare_enable(controller->cclk); - if (ret) + if (ret) { + clk_disable_unprepare(controller->iclk); return ret; + } =20 ret =3D spi_qup_set_state(controller, QUP_STATE_RESET); if (ret) - return ret; + goto disable_clk; + + ret =3D spi_master_resume(master); + if (ret) + goto disable_clk; =20 - return spi_master_resume(master); + return 0; + +disable_clk: + clk_disable_unprepare(controller->cclk); + clk_disable_unprepare(controller->iclk); + return ret; } #endif /* CONFIG_PM_SLEEP */ =20 --=20 2.35.1