Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3470936rwa; Tue, 23 Aug 2022 05:25:30 -0700 (PDT) X-Google-Smtp-Source: AA6agR4qQsp/hnX0nVHCjwhqsjyg8cXrTh/R7FWd+7L6eFHamj103B3XZFmyurVFG9/vIVbqtwLY X-Received: by 2002:a17:902:7487:b0:172:fdc5:ce25 with SMTP id h7-20020a170902748700b00172fdc5ce25mr3761767pll.109.1661257529753; Tue, 23 Aug 2022 05:25:29 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661257529; cv=none; d=google.com; s=arc-20160816; b=mdA4BZYrZeT4l5TZ8Tb2gBut3Az6UUG8MgU3P5ZGxC8VknrC6ZWEiDq5bE9KgG1Rg0 9nWQ26ebL1s08Z01IoFnzkn+vvHOliMIBwbZYIKBgF+JKJsC8p7QoWlob88B8aqocuji GHnpgunnk05lTwpLRt+eCj57HaoNsRezhe8lJTeR1kfM6udBH9YYLHasVcSUu7NgPGon 1zFDyDVX5Dxf2yJvk8M0I6JdWwv/qVVH7wsC9HWZQGUklzGghYXZWPONo2YzitYtzjOg 6TUfYzWTEWWmfOE73J/gu6ow6pGcUzv/WqwXpO45+cdzn1BFQwl7QDR+c76bslsvK14B hYBQ== 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=FQzjXsQSpqMMqAfYKECl3+Gp4kzZdfSOYmkCq5nLkwU=; b=DaGzIUwef/e9Ux5DEhwZQqCFKRgQYt8OCzP1zzM7+P0dNlzKOyiKeIgiXvhFq+xqR0 C64g+U2rpKcmfltniCB8qcy6EIm/0zseVZcV+Hehwk/1xRHPO3KIlM0RdZXTt3kDhEmf Cn3WCIRc1nO1zFKaXD+XXfPukwlXSWRIIlUwQfyEojb6Sd+JfSvCZxxknCsknThUbHn/ nZ29FP7VJpaqpca6lqfjU3nBR8tmNvluXG4u1w7p1bmS1Q6znKyMvlUHIDHu7pptx37T 5m68fO1hPUBc8A0iJWZHK49E2w+Ig68Y6/jA2BbjkngKpbsym4np1fr8IomZUagRsJWd iATA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=mofMnoaN; 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 g6-20020a170902740600b00172dc7ef8e7si7802291pll.499.2022.08.23.05.25.19; Tue, 23 Aug 2022 05:25:29 -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=mofMnoaN; 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 S243250AbiHWJtJ (ORCPT + 99 others); Tue, 23 Aug 2022 05:49:09 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:55908 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352566AbiHWJqd (ORCPT ); Tue, 23 Aug 2022 05:46:33 -0400 Received: from sin.source.kernel.org (sin.source.kernel.org [145.40.73.55]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 404596050F; Tue, 23 Aug 2022 01:44:17 -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 sin.source.kernel.org (Postfix) with ESMTPS id 40838CE1B44; Tue, 23 Aug 2022 08:42:43 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 43B0BC433C1; Tue, 23 Aug 2022 08:42:41 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661244161; bh=iwlSgC6Aa0nWy47+NA8m36MZZmWgMbKUT66h/Y2MjP8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=mofMnoaNR2AicMb4hCqphwc93rudAgDjnzO/MNE1FSjNidMDThgEffG3bsv/dLxk+ 5cg5SEAy5WB0I37QgeyIi2TRA6ZjJOy4iWt1t8lofMJqEJkVNh9eLEIg5QO7PwGJXk F0H3Zq1fNhjPdgeZE7IqcZGeWS1sWr7l+Ky5b0Ew= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miaoqian Lin , Linus Walleij , Miquel Raynal , Sasha Levin Subject: [PATCH 4.14 095/229] mtd: maps: Fix refcount leak in ap_flash_init Date: Tue, 23 Aug 2022 10:24:16 +0200 Message-Id: <20220823080057.103541548@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080053.202747790@linuxfoundation.org> References: <20220823080053.202747790@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: Miaoqian Lin [ Upstream commit 77087a04c8fd554134bddcb8a9ff87b21f357926 ] of_find_matching_node() returns a node pointer with refcount incremented, we should use of_node_put() on it when not need anymore. Add missing of_node_put() to avoid refcount leak. Fixes: b0afd44bc192 ("mtd: physmap_of: add a hook for Versatile write protection") Signed-off-by: Miaoqian Lin Reviewed-by: Linus Walleij Signed-off-by: Miquel Raynal Link: https://lore.kernel.org/linux-mtd/20220523143255.4376-1-linmq006@gmail.com Signed-off-by: Sasha Levin --- drivers/mtd/maps/physmap_of_versatile.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/mtd/maps/physmap_of_versatile.c b/drivers/mtd/maps/physmap_of_versatile.c index 961704228dd2..7d56e97bd50f 100644 --- a/drivers/mtd/maps/physmap_of_versatile.c +++ b/drivers/mtd/maps/physmap_of_versatile.c @@ -107,6 +107,7 @@ static int ap_flash_init(struct platform_device *pdev) return -ENODEV; } ebi_base = of_iomap(ebi, 0); + of_node_put(ebi); if (!ebi_base) return -ENODEV; -- 2.35.1