Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3090504rwb; Mon, 15 Aug 2022 17:53:40 -0700 (PDT) X-Google-Smtp-Source: AA6agR6RQW2sCq1gERQWelh2bp5mGZd5Ltm6hst6b04DVftzai3B6Haww9+eNxTZ26HndVZ6DP1P X-Received: by 2002:a05:6402:b1b:b0:442:8cee:177d with SMTP id bm27-20020a0564020b1b00b004428cee177dmr16380303edb.318.1660611220653; Mon, 15 Aug 2022 17:53:40 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660611220; cv=none; d=google.com; s=arc-20160816; b=cAjmtP/vzcKVKD4R5UcxPYT6M3qCzKMcDoh/+V9ecjJWtFS9/o3au1k+vgdkxuI7FO Cha360wb0K+1nFXnW1d1MkCNmp2ixzxrMpMJALt15nfKF7+GI76OGNEy6t6ZXyTIudiG 3xSUTWxKl2muf0PD5Um1nhiaNXVR/3AOMJ4K1d0CIsncCs6+6uhanuFrlCejZ36bs0zp /hOx3Q8TMAak+ewlfhj0jraWo4whgtTggaQSYEqwUbA/8hgdm95pguB8LUJaQ1tr/e7K Hcwwvzz8zsWJfGwwYUHKJjWHUnOdRLW3zq1DTOLAvbFemcsYZjQIHYmOBv+NUvp/3j9x r1bw== 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=Ex0mfRHYf+Tkb3R400jpsQtnqzrgqhQR26LQ7oVf2dA=; b=gQBZAg1x/HvKCIDAjVc9dRk2vO6wiNF07p1WyS6ciFn+Ps5F8svlKs3D7egaPt4zB4 2lYl1TW5APjcyNN03vfmUc4qHqIigBrRgIGsyY+bNe/zASgaRAJuQyzKHMjo+Vz7k0tU U1DIsXWTq9Dhh2aOv5wzN9ujlsE7b+M9zbv+BsMUbYuc0MuljvJulav5qj6XR2mR8U5u jdcbbJGjIRsc6E+Vpx92XspEHix2LokSgCk+3O7jI4aFa7HFKQ9hRcXlUQnDy9m+o3Q4 QbyUK+WvEqh1uVvjfpxeCDPvSJs+9inmITODt6e3Jz2Hb6WL/LXASl3h8DgvFF4/zhTs zYTA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=FHQCalVx; 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 md17-20020a170906ae9100b00730d33c8fb3si8200473ejb.49.2022.08.15.17.53.15; Mon, 15 Aug 2022 17:53:40 -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=FHQCalVx; 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 S1351233AbiHPASR (ORCPT + 99 others); Mon, 15 Aug 2022 20:18:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:54284 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347107AbiHPAKR (ORCPT ); Mon, 15 Aug 2022 20:10:17 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [IPv6:2604:1380:4641:c500::1]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 11A42173A36; Mon, 15 Aug 2022 13:29:16 -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 34F2C61184; Mon, 15 Aug 2022 20:29:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 2B70FC433C1; Mon, 15 Aug 2022 20:29:14 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660595355; bh=7Lvbr3yWglt5qIfD10p3dizhg1TsWM9D8DoP5cAkLTQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=FHQCalVx0W+DeBhVMYo/wcHaOcqePCpXSPzVGHP/58XL/we0uYHb24XvYAfWQWCKH /zHQgpxAh2YCuOBstcVTfA0BBq0zKa1Uoa519m64RnQJ1tsWDw2VtCCyJddPpfxVCL V2gaXG6kncLMkleyuF2ryd6t1CISp+JDBcOAg+FE= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Geert Uytterhoeven , Wolfram Sang , Lad Prabhakar , Sergey Shtylyov , Miquel Raynal , Sasha Levin Subject: [PATCH 5.19 0739/1157] mtd: hyperbus: rpc-if: Fix RPM imbalance in probe error path Date: Mon, 15 Aug 2022 20:01:35 +0200 Message-Id: <20220815180509.032707517@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180439.416659447@linuxfoundation.org> References: <20220815180439.416659447@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.1 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,T_SCC_BODY_TEXT_LINE 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: Geert Uytterhoeven [ Upstream commit c223a38d62e57aa60a890ea7247e3c58a54478e6 ] If rpcif_hw_init() fails, Runtime PM is left enabled. Fixes: b04cc0d912eb80d3 ("memory: renesas-rpc-if: Add support for RZ/G2L") Signed-off-by: Geert Uytterhoeven Reviewed-by: Wolfram Sang Reviewed-by: Lad Prabhakar Reviewed-by: Sergey Shtylyov Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/f3070e1af480cb252ae183d479a593dbbf947685.1655457790.git.geert+renesas@glider.be Signed-off-by: Sasha Levin --- drivers/mtd/hyperbus/rpc-if.c | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/drivers/mtd/hyperbus/rpc-if.c b/drivers/mtd/hyperbus/rpc-if.c index 6e08ec1d4f09..b70d259e48a7 100644 --- a/drivers/mtd/hyperbus/rpc-if.c +++ b/drivers/mtd/hyperbus/rpc-if.c @@ -134,7 +134,7 @@ static int rpcif_hb_probe(struct platform_device *pdev) error = rpcif_hw_init(&hyperbus->rpc, true); if (error) - return error; + goto out_disable_rpm; hyperbus->hbdev.map.size = hyperbus->rpc.size; hyperbus->hbdev.map.virt = hyperbus->rpc.dirmap; @@ -145,8 +145,12 @@ static int rpcif_hb_probe(struct platform_device *pdev) hyperbus->hbdev.np = of_get_next_child(pdev->dev.parent->of_node, NULL); error = hyperbus_register_device(&hyperbus->hbdev); if (error) - rpcif_disable_rpm(&hyperbus->rpc); + goto out_disable_rpm; + + return 0; +out_disable_rpm: + rpcif_disable_rpm(&hyperbus->rpc); return error; } -- 2.35.1