Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp6802892rwi; Mon, 24 Oct 2022 06:21:36 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6qT9RrEuG7tfLVKJwdSDCkKyLJu2IsH7AxP1nurBTi0d1DTrEAr1OzFWrxplBOKVZcxnqu X-Received: by 2002:a17:906:cc10:b0:78d:f741:9d87 with SMTP id ml16-20020a170906cc1000b0078df7419d87mr27587271ejb.295.1666617685260; Mon, 24 Oct 2022 06:21:25 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666617685; cv=none; d=google.com; s=arc-20160816; b=iQu13qjm7fTMLMX1bBIZpGpgstyzKshCySRjWsl+H4qlN9RS+xnF3VQv5PQuvCZ6Kr 60Ef+B8T9Aw3kc2LrT0j1tcSJ43bZwQtJxbc4dYI9ETStkJIKI7CyQBFJChYvN9rJavx HPnGTHpjpihfjhS6ePXgJGJxreL5u1FtoZY/vAUv6/nzbhiKR787YWHZ04GmIUV4yqNG fdb9G9EB8gHFtIyvEA0+LbUl9ToB1lHPZbM23kKXKe+gadlyVHqEv4l9f98Xa6ZR4aMc 0vfM+VjMQCpmUJw1Rd51mo+KtiXjmR2mpD1hYgVlcjY1y3NK8rDc0iIhOgxbTyiGe/Tj K/nQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :user-agent:references:in-reply-to:message-id:date:subject:cc:to :from:dkim-signature; bh=Ltioo1cUxSjO/ajzzZRy7JIKD/bLDfSkewSjDzNolrg=; b=VJJ/BjnFHfFKJAVuOiQjJE61Ek5bPiDsmC8ekMbfLkmTJUGPSlJGDvkHNIwrmFZcMB tp/b55g1Z205Kli5SeOhSLsYCvnpbsd4Ke85FT3OABdFJQnsW09WxOPWauM0BTWaBoYr od58xCi+HqH4z2nBZRmdAt3m0V8kwXVh0Gg8s9XMwEIIL1y0Ewnul95yaTqUfpV2oIZB Juk1UJHg21kOFvyxHzSzxA5tt0k7ENPfPdiEpIsXrj6b7ej/UzCeHOlcWCYaojuH3VTJ lO6Sd+1QNLYI3Pf+JtCLHkpOWHzJgqcny0uaCsUyCYow+Z93Gms4ZAsBeIaEd1pcgOgB 5NSQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="M/cH+aTw"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id gn42-20020a1709070d2a00b0078d0f88a6e9si26547364ejc.284.2022.10.24.06.20.59; Mon, 24 Oct 2022 06:21:25 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b="M/cH+aTw"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=linuxfoundation.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S232635AbiJXMGS (ORCPT + 99 others); Mon, 24 Oct 2022 08:06:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:47482 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S232746AbiJXMEN (ORCPT ); Mon, 24 Oct 2022 08:04:13 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 2D4FA5EDDD; Mon, 24 Oct 2022 04:50:25 -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 0F373B811B8; Mon, 24 Oct 2022 11:49:03 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 3B5E2C433C1; Mon, 24 Oct 2022 11:49:01 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666612141; bh=yXMCTS8eONU++mGlDljHj3JlkYoORL7wIFX0W3Arlcs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=M/cH+aTwEG0r1e3eM635HEYkZFFPxnjx4KK5K+g5RkKtmLqvwYlcH0WoE7Pd9X7GX k8GE0n0g4XYfMi+HKL2sTEeFnPjEtnjK4sW3wJDXGKLRmsG3/j8dhwEHeOGnsUyEqV dJC72Rgj4Nk3qM/qu0vsXLEvDW17oTKMJBBv6SiQ= 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.14 085/210] spi: qup: add missing clk_disable_unprepare on error in spi_qup_resume() Date: Mon, 24 Oct 2022 13:30:02 +0200 Message-Id: <20221024112959.811054555@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024112956.797777597@linuxfoundation.org> References: <20221024112956.797777597@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit X-Spam-Status: No, score=-7.6 required=5.0 tests=BAYES_00,DKIMWL_WL_HIGH, DKIM_SIGNED,DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF,RCVD_IN_DNSWL_HI, SPF_HELO_NONE,SPF_PASS autolearn=ham autolearn_force=no version=3.4.6 X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net 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 (“spi: Add Qualcomm QUP SPI controller support”) 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; ret = clk_prepare_enable(controller->cclk); - if (ret) + if (ret) { + clk_disable_unprepare(controller->iclk); return ret; + } ret = spi_qup_set_state(controller, QUP_STATE_RESET); if (ret) - return ret; + goto disable_clk; + + ret = spi_master_resume(master); + if (ret) + goto disable_clk; - 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 */ -- 2.35.1