Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3407458rwa; Tue, 23 Aug 2022 04:23:12 -0700 (PDT) X-Google-Smtp-Source: AA6agR6XW3314D6NasDHkzZXGHDJQGpHeYv2PggD5lIzgsjpcfPB6IlMvuWYjKkdm+IpSaLRdEmp X-Received: by 2002:a65:6cca:0:b0:427:17e6:b32b with SMTP id g10-20020a656cca000000b0042717e6b32bmr19554251pgw.349.1661253792492; Tue, 23 Aug 2022 04:23:12 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661253792; cv=none; d=google.com; s=arc-20160816; b=O25VFtUdzM5/BGktEHDDgS3DwKzv3bIemBP5d3PD1vLKxhGkGyC13Nuq9stsI26qzs nPdkFWf8RVPZVKym+wiyBBtXMm8JPMq/1sXInEjXY2O+4HaycWQ+8c23ltF6/lNSD7O+ hOVnT6qwiSw0zscqe9U2zUqlWdkEsFKWuWKGPcECSVMtk/toNZV9yhoedOnj1zznnTpH jfbx1iQdEzhU/bDa5rWpCVTieCbBIZ38n5HcU/9Q2hNl/mSHtZ1Das1pjmdqBO4tkOrE yOWcsy11K4g9+Xl8wtPc/iDNFGAS5PQkvSCcM6m+/2gdNi315pg8ikvgHLxYlgTghP9t 1APQ== 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=nzCsNX6eWs6zk9ndnAH6l6lCrRnss/Cqc04xnfW5epKzostQvctiwUu3vDhMg14WVp ZNKyKf5wl1xkKi5ljoOGIPayNhrt123eUTfnAhS5kH4FE4wz/w9DckBDOmmR4AtHvXMo K5X+JTqlpMSOq/6x5nGM8/Kwex8rh45R9hQJ05lbPKNAaXRS6Ku3cIb13EWAUJ12NpxB mSAOCDvXWJATycANeNURwJfH9az2yxlt2fIlO7mTg7Gfaa5KS4Qc3rem3bokcdsstxMz Xyi7KumFlDfzGbPFefMl4FW6xqy02RZPuTwGb5IQ6Scy+7g5WI9O7izlK2SGtvSxEiUh ++vA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=rAxgEsWt; 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 b9-20020a631b49000000b00415e130eb76si15014427pgm.685.2022.08.23.04.23.00; Tue, 23 Aug 2022 04:23:12 -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=rAxgEsWt; 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 S1356007AbiHWKzT (ORCPT + 99 others); Tue, 23 Aug 2022 06:55:19 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:40100 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1355951AbiHWKse (ORCPT ); Tue, 23 Aug 2022 06:48:34 -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 3BB17AB06B; Tue, 23 Aug 2022 02:12:13 -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 CF9FA60F50; Tue, 23 Aug 2022 09:12:12 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C0836C433C1; Tue, 23 Aug 2022 09:12:11 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661245932; bh=ROwYacelnhogMjbaFhx5Z+LfPE39x335YCVt9z0dvRA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=rAxgEsWtFNFkAYaLZJTdMHdi66AJ2vRN5+SfJ7FLMF48HCDpCNk8TR1xkNaDRmCTP WDJOWPA0OdI7fONnGqZZZ1/OyDHI0NlBBTaagxx7C9zocN1i1tXmDYN2rXDJlx5188 tUDhuOzOaVKtydhUt86snOh4rQ964zjDBILNLapA= 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.19 234/287] pinctrl: nomadik: Fix refcount leak in nmk_pinctrl_dt_subnode_to_map Date: Tue, 23 Aug 2022 10:26:43 +0200 Message-Id: <20220823080108.918959307@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080100.268827165@linuxfoundation.org> References: <20220823080100.268827165@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;