From patchwork Mon Oct 24 11:30:22 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Greg KH X-Patchwork-Id: 8441 Return-Path: Delivered-To: ouuuleilei@gmail.com Received: by 2002:a5d:6687:0:0:0:0:0 with SMTP id l7csp401424wru; Mon, 24 Oct 2022 04:48:38 -0700 (PDT) X-Google-Smtp-Source: AMsMyM6PiUptELlSJJB8MZpBFlX5Rc6OZpVVy2AYp3EEodlsRgtWuYuPh2XbJCVtbBSfSeWowm4l X-Received: by 2002:a17:907:720e:b0:78e:2b59:fdf1 with SMTP id dr14-20020a170907720e00b0078e2b59fdf1mr28067648ejc.659.1666612118575; Mon, 24 Oct 2022 04:48:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666612118; cv=none; d=google.com; s=arc-20160816; b=NxEOcjjznpVMYp0Csb7xSSgaQqXjsSUwJlFyLDce7NAAwGk/mkCgnBSwVjJKk5Hfnq MFBSAx6LTelsCxIeJ42wdI2MRKc1tuAPnLK3nE3nLSDaaeh+ldzDNWt270JWTviC2Pem kxJ9Cd1skN4z314+9trkmpN/cDr4dH3rGbzWXoVI2Tls9aGchdLjUP2/D8asZRnRIc2o nxeEsDFgffsgvSXoHEjujU3y6V9V8rP9P8T3Upn0WBEqxvHBIgOuttM34l6cpg3k6U11 hWi6cqtuhJvf1Qipoq7iqePwP3BviSn4qGBZfuczTlwXbg1BXSBsx1VhvJrf5xajCTOW GZmw== 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=vau55XG4AtDA/bradHiTIFS1hkZL53Ox2+1RaoOTq/Y=; b=MJopIgYSfIL7IOKAcRAe2fNLWoG6IN+XMOIsn1C5AZs0/Dlw0vBRsymzQgtQDPdtpk sEv8n8hqeS3tDA/7bwIpfOkSRVVdAsETXV2PNy6kmfljVeFRGoUiP/8yVJxOP5MqWDqf Bzn306ZaxJAONwib3u/apR2i3D6Z6VCKzzjPATVFMZhA5AjZID4WsECvnmrR6i4Bdcqh L4xIzolz8q8rsf0YTE0fOTnXanS+snlBdOUCG/jb4N4m0ivJOYo8XFmI6h2bwoNiVy+E 3ZUzC5s/gv0XxxLcsHObw7NvbUBo0jNkp4NQWALfls9hJScdUlsmMv79qIAdOnoimlCV UcUQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=ep3w1nA6; 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: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id hq6-20020a1709073f0600b00787c0e9818csi32642647ejc.568.2022.10.24.04.48.14; Mon, 24 Oct 2022 04:48:38 -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=ep3w1nA6; 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 S231713AbiJXLrg (ORCPT + 99 others); Mon, 24 Oct 2022 07:47:36 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:43126 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S231567AbiJXLqC (ORCPT ); Mon, 24 Oct 2022 07:46:02 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id B6CBF75FED; Mon, 24 Oct 2022 04:42:37 -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 dfw.source.kernel.org (Postfix) with ESMTPS id D7DE8612B1; Mon, 24 Oct 2022 11:41:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id EB10EC433D7; Mon, 24 Oct 2022 11:41:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666611676; bh=BGNZK/cB2kFggn5itPQ393cYoDcWc44Ku6wOYLbv6xc=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ep3w1nA6KEnmDNPtj1ehOionWcNcVzqUVn0aS6ZR040Uizz2hmpXQKbo3CqdeGD1X Lx+HcMq1/Yrhzu1EO/s87ttbAH6ZgUaf3vzS5YUxrThrCVGrZjuUBibfi7mO9a+52z 5im7mZrPBjFDj7oes6/uJ92Mnz9qwF7GNdtgLwRk= 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.9 068/159] spi: qup: add missing clk_disable_unprepare on error in spi_qup_resume() Date: Mon, 24 Oct 2022 13:30:22 +0200 Message-Id: <20221024112951.953277693@linuxfoundation.org> X-Mailer: git-send-email 2.38.1 In-Reply-To: <20221024112949.358278806@linuxfoundation.org> References: <20221024112949.358278806@linuxfoundation.org> User-Agent: quilt/0.67 MIME-Version: 1.0 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 X-getmail-retrieved-from-mailbox: =?utf-8?q?INBOX?= X-GMAIL-THRID: =?utf-8?q?1747569469176916439?= X-GMAIL-MSGID: =?utf-8?q?1747569469176916439?= 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 88b108e1c85f..431cb184595f 100644 --- a/drivers/spi/spi-qup.c +++ b/drivers/spi/spi-qup.c @@ -1003,14 +1003,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 */