Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3083489rwb; Mon, 15 Aug 2022 17:43:30 -0700 (PDT) X-Google-Smtp-Source: AA6agR4B710vGaem0AiATSeWMxdo4r7FTsV15cQAUvRd3YUW803LejHQ/KwidL+31CJGlpffB9n4 X-Received: by 2002:a17:907:da0:b0:730:d0ba:7b13 with SMTP id go32-20020a1709070da000b00730d0ba7b13mr12446692ejc.332.1660610610604; Mon, 15 Aug 2022 17:43:30 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660610610; cv=none; d=google.com; s=arc-20160816; b=APP1aTsuiHvKgcrUdh+XTZg2qlA01W+f19u+6QJVrx6dN7ILQGE9XgWPoU6uLC0jVf 3zhFns5VOuww5WBWXE44gvaX+/9BmauIwqzf6oQrV0vncQkVHQeWO9LXLRhZMbSE7HUQ /8RrTRLLtDYv4dDd4fcA56dW7F0Cy8UO7B8x7fKHytfPfjJjPx9U4gDFAm0ca2XQtq74 Dm9todsH0y7sr7QmRZ24gRnUmPt94hc2tOrxgiEmIYWqDQXhF0/guOfdOTVnl6gOH97o i5aKegY36OsTpQIRq/I/L78ydn7smTL9J0kzV2SEBohrnzmRgb/MxZcV9Wtlf/+ETzvi YAxw== 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=Ed0tFEKW/U5tm6bXt3hDFdUL9dQOHKmsOGTuS+db9mOzoJoE4ixapMWvMOt6RhTzan aDWpoLp3QroLu/7913k/mVLkqrgh90jruHwHG6dv624jGA97//irnY57jr72+9hRCxoZ FNUFhWoVrjLzqP+Ay2cZ5PMv0XoBh8tQ/GojY/trX8mCVqSVwn9CEW9UKTNBfVmuV8YO 5orFq5HWG40rAq0ULVs6LhgvoEpKV5BOYsBxSgq7uzF4O7Xsqdn8Km5tfNy/QuZzDr5t AvgvlrQQb/qZkNAQMwBwhgiIvSaEyAYepQbue+mcYdtKf6rEiYnCH7j4iS58YrilsI6J kvPw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=d773Nw+R; 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 dn2-20020a17090794c200b007314ba7a583si9211691ejc.908.2022.08.15.17.43.05; Mon, 15 Aug 2022 17:43:30 -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=d773Nw+R; 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 S1350099AbiHOVuR (ORCPT + 99 others); Mon, 15 Aug 2022 17:50:17 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:33676 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350120AbiHOVrN (ORCPT ); Mon, 15 Aug 2022 17:47:13 -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 48AC75F12E; Mon, 15 Aug 2022 12:31:01 -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 21371B8107A; Mon, 15 Aug 2022 19:31:00 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 79C21C433D6; Mon, 15 Aug 2022 19:30:58 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660591858; bh=7Lvbr3yWglt5qIfD10p3dizhg1TsWM9D8DoP5cAkLTQ=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=d773Nw+REw55AD6h01+PJzjIqop8COkygmOGdmPAdRqZ4VD+5GHNFNtl9IdZFAuCq 77mKePj4Y+7aHergu2r2NmAV+LafBPEO2GutlrtovWqUYgy2iOoTIyLJhm5DZ2e5qP 1R4OPD0cRHn2casgBNR5Uk0ialDgfk7jFJ95eJZU= 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.18 0691/1095] mtd: hyperbus: rpc-if: Fix RPM imbalance in probe error path Date: Mon, 15 Aug 2022 20:01:30 +0200 Message-Id: <20220815180457.960816982@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180429.240518113@linuxfoundation.org> References: <20220815180429.240518113@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