Received: by 2002:a05:6358:1087:b0:cb:c9d3:cd90 with SMTP id j7csp1143015rwi; Wed, 19 Oct 2022 07:12:55 -0700 (PDT) X-Google-Smtp-Source: AMsMyM7CxTcnv50qGVk02XXsZjagSA2VPquRhQqdvKIb9jAAlEh7XgmUon+TsVSB+TOkIKlzqlki X-Received: by 2002:a50:cc07:0:b0:453:4427:a918 with SMTP id m7-20020a50cc07000000b004534427a918mr7686313edi.121.1666188774995; Wed, 19 Oct 2022 07:12:54 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1666188774; cv=none; d=google.com; s=arc-20160816; b=q50WaPUiHxlsx+qEHWgEou5zkD4fqObQ7pLt58cQOPEv5VHnfhBbTvcSJwDZS821VV NtxD8YQ+C7IdE5dMUrczQl8scHoCfGGJNDIaRmvEDG0mgF4qNBSyqknwAvDilfPn2lBG uh/sXdOInJ1HNPJlJ5aHodvXfvwcJciv67Z1cH3fcKiFztH171eFS4JJdHSrVhq6SZtB 888aCOtkDJh1QuZYfo9CQYFArVZcseKaxduUnWDXWtsZ9eam7JNQdKaXgrTZsH7rTcEJ iVQA67VPFcLPezXDMAtLMRGPSGoy96o7HfBZbCdJ/xX1UbTMd4MVmb2XjeeuMIdLp+v6 /SvA== 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=hwAFJISQXBxKrTnk6Pj2/+RIEOifuHUpBzBhdXa2T58=; b=FUdu5t2DbwQNWb9AFPtOgW6qFVh/DPMI5i2fzrn4ql2h5AC6+4BxmvFtqHv2h+GPIQ 768LLb6f8zcnKnV5jSnwdKYmhrSNQpPplO1+z1LjMRHM+gjv+eisSYsOkvOHLriSwGB0 4QoW6WtgszwnqS3gum2UXHvU2OGCgODzFegVXVk4y9rTgl4Jjnp64lPa1CwL0B6xyM7M qvYbtXYcsxflGUDYo/zsAxILjIc6EAGu6H8z93Zt2sf2f+wg7Rs78KpZtZeCMvUDDRFg Z55FicRamx7GWjMA2K5Bh0x8OnuuQmRGWi5DH2ZWeQXcXmkqO9mbTxwA84PYVYpEle06 R3Hw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=tWvluceJ; 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 qw20-20020a1709066a1400b0078dad5e8d65si13035327ejc.68.2022.10.19.07.12.26; Wed, 19 Oct 2022 07:12:54 -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=tWvluceJ; 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 S233783AbiJSN46 (ORCPT + 99 others); Wed, 19 Oct 2022 09:56:58 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:36454 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233703AbiJSNxQ (ORCPT ); Wed, 19 Oct 2022 09:53:16 -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 7E4771C8816; Wed, 19 Oct 2022 06:36:34 -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 7A86FB8238B; Wed, 19 Oct 2022 08:50:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id D1EE7C433D6; Wed, 19 Oct 2022 08:50:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1666169432; bh=Rz9rDCBJAQ2vRjx+afllaCE7dQcrdHH6ja7SalU0vXQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=tWvluceJ4+KdQ8KQbcJMblJB18QlYqKR9G3Ejz/gPAoU6tI2b5Fl8VPK4FTcu7ZwN PIFjC/BOvgm7pJKf5JYQrBjuJxIFK9xb8SplI/BIOjthOWsWl2vLemDrvLCwoXd07t zn5PmcT/IrLdsl/y9qQJ14iPjvW4zYyCGxdWZz+E= 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 6.0 267/862] spi: qup: add missing clk_disable_unprepare on error in spi_qup_resume() Date: Wed, 19 Oct 2022 10:25:54 +0200 Message-Id: <20221019083301.819748343@linuxfoundation.org> X-Mailer: git-send-email 2.38.0 In-Reply-To: <20221019083249.951566199@linuxfoundation.org> References: <20221019083249.951566199@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.4 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 00d6084306b4..ae4e67f152ec 100644 --- a/drivers/spi/spi-qup.c +++ b/drivers/spi/spi-qup.c @@ -1245,14 +1245,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