Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3412427rwa; Tue, 23 Aug 2022 04:28:39 -0700 (PDT) X-Google-Smtp-Source: AA6agR7naREjxl9yUAf0H4/i9DvIjx+p6tJl/cMFAGNqa+Qxx1HxtJyASXeRHjkNVHdAx8pc6CR6 X-Received: by 2002:a62:27c1:0:b0:536:32d2:d098 with SMTP id n184-20020a6227c1000000b0053632d2d098mr17930552pfn.63.1661254118847; Tue, 23 Aug 2022 04:28:38 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661254118; cv=none; d=google.com; s=arc-20160816; b=McDqbe8pl6PLrG94B3m5ovX0kls68262UHYrT9s/VHxKGwV/2MYVthyomhXWTqg4BK tyHlLF4v+qT/69B6YFetf4++rUT8uNatRnfh6dv6bCYyPBzKMfY3dlQ+6jTYcmnNBE6I 5hzSA2lMDehFxOhA08pEJiY4Q7xd3F51ISuXn5bEqMtHz3yutHHZGlgXJDPbsqDl2a2L dAuZ1Ys8LKwVRtFikaySCF/rLMgNLaOUdF+qsRxFfUPSn+zNdxmXYPvlS+pCC57l0wzI MXCWjSgmpKe/Y5l2cqg/lMOKbNmAug2lwkVuov3yMPmqKB9Hncfm2hmgXvCK9zAQ0C2v r1VA== 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=6qtMBkzbCFkO8O9EIV4yivGn90xX33MUG2WhBg1t1jU=; b=Nw2WYF0MrkqxKJedrvFJe9WYRHDpEY62IjahGOZ9YfRQHEnl3dh121JWqOASdi6vUo 3/RnTEhY+vWRcp8WgwDyJviMWo8utRKv8u1lEqRvR/JVTjjN0n8FEdbrqTdGyzvTM+fk zDN5s9sUlcy5mj5r/pG0J/ra8ooO0aZzt7NJ7EfU9kpCGbuUKLBluXOhaY6E59XSqftb 5HlFE6FaHcCHw7kCUHIJ19WYW0I0jlRdLe+HoUYd59DdoV/kVy+3nQ+E0auEL4n40UNS MLRQjrHNIZTUbhFzMFyxcOcM/K1uZc1pw9ixtNZYyLGTxB9rImQgMDElNXP3zw5ZSRjL ZQxA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=MRn1ejos; 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 h6-20020a63f906000000b00419a2dd0b3bsi12993475pgi.374.2022.08.23.04.28.27; Tue, 23 Aug 2022 04:28: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=MRn1ejos; 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 S1353108AbiHWKOS (ORCPT + 99 others); Tue, 23 Aug 2022 06:14:18 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:46704 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352782AbiHWKGQ (ORCPT ); Tue, 23 Aug 2022 06:06:16 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 0FAB4BC0F; Tue, 23 Aug 2022 01:52:57 -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 A87BBB81C28; Tue, 23 Aug 2022 08:52:55 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id E4CF4C433D6; Tue, 23 Aug 2022 08:52:53 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661244774; bh=ROwYacelnhogMjbaFhx5Z+LfPE39x335YCVt9z0dvRA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=MRn1ejosB9+EBAl7NaJJ5n3KpQoDgDmQHwcAjLCxCejVq7LYKtDl09qB2tIpHu6KS lJ7hZkr7PFQ/w+IsNS9S9e1KBI4eAtDzO2gIV9vB5bPMCb8KOFBvu71YHAgoNDiqHO JiqAaCWwho5bSQfUxk4G78/qSS7HFCtMEcEm5q/A= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miaoqian Lin , Linus Walleij Subject: [PATCH 4.14 188/229] pinctrl: nomadik: Fix refcount leak in nmk_pinctrl_dt_subnode_to_map Date: Tue, 23 Aug 2022 10:25:49 +0200 Message-Id: <20220823080100.324783308@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 commit 4b32e054335ea0ce50967f63a7bfd4db058b14b9 upstream. of_parse_phandle() 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: c2f6d059abfc ("pinctrl: nomadik: refactor DT parser to take two paths") Signed-off-by: Miaoqian Lin Link: https://lore.kernel.org/r/20220607111602.57355-1-linmq006@gmail.com Signed-off-by: Linus Walleij Signed-off-by: Greg Kroah-Hartman --- drivers/pinctrl/nomadik/pinctrl-nomadik.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) --- a/drivers/pinctrl/nomadik/pinctrl-nomadik.c +++ b/drivers/pinctrl/nomadik/pinctrl-nomadik.c @@ -1455,8 +1455,10 @@ static int nmk_pinctrl_dt_subnode_to_map has_config = nmk_pinctrl_dt_get_config(np, &configs); np_config = of_parse_phandle(np, "ste,config", 0); - if (np_config) + if (np_config) { has_config |= nmk_pinctrl_dt_get_config(np_config, &configs); + of_node_put(np_config); + } if (has_config) { const char *gpio_name; const char *pin;