Received: by 2002:a05:6358:5282:b0:b5:90e7:25cb with SMTP id g2csp3468865rwa; Tue, 23 Aug 2022 05:23:35 -0700 (PDT) X-Google-Smtp-Source: AA6agR7L9JpNKgAl5bvWArLxrwvmbMLhYQuE31lCzXNaf+w0uBr5zW/Qj/Cmql5JiK+1s+zq3rbG X-Received: by 2002:a05:6a00:114f:b0:528:2c7a:634c with SMTP id b15-20020a056a00114f00b005282c7a634cmr24936162pfm.41.1661257414934; Tue, 23 Aug 2022 05:23:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1661257414; cv=none; d=google.com; s=arc-20160816; b=fsX+FpypLYSwMHQdKWoCF4HOfixaHzsVIaArqnITO+43kXnVWq9OPfUKKT5IsK6tnt ohyfBKOW8IAmn1ICoM/+m4s1//w6WE4LSuHE73JBi22psuHWSO/YXkYoLTJql4jtbY68 NoNoJXIwShxL24ul310Z5OGm/J6kx+Qi+nZB1QBTsGUCyzwCkc+VsmShVb5kX5HwJ1Lp 2bXGBI9gYdkTSpTAqr88saD0rzot3PXXD/XZojTfX6g7qGEZWO9/1hO9loOSEgBKcbJg UsVO+pXV9q/EQbj61W/jIOr2FxxI/I3MnfjMBZUvE36IBjvNGg1v4rdtIfrPFA9d/kTM dx9w== 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=8tbScILhlNZdOhktIAWTpf4N/VifRHppgo2gXAWs6Ag=; b=EBDB1F78MlhYhSQ4w/Y+l3E0E/znaA8DMzq4ry/FfKzh0KaWz7Kr7HHvQ9fYZXen56 9ASLEpAdxu+Nfnp5+XweJ3pZyoB80nUX1QheMMs56ooxjfW4X1XkjXtW4YqZmeCLx16U VAubDGOFtQ0FdRcFr4Ajtb0yI2/PgwGi/RqEp1Ha2s3VIDAciUPUz67JxUlwHcXFr9go hpbx0d5vTJ9Hwxt5mcYJ3VS2V98spGkJZm7sZ0b1Cm3JdRMGWvyAIXGheug1Gl8m5yfN erUUf23XZmJVp5ze2BEt/UN2IKi/x2ir6dVpsZLLxizMa5LcwifDXzXDqSmkQPqcdnci yxWA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=eqf4SPAg; 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 k9-20020a170902ce0900b0016db1b1a7adsi16250494plg.210.2022.08.23.05.23.23; Tue, 23 Aug 2022 05:23:34 -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=eqf4SPAg; 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 S244058AbiHWJth (ORCPT + 99 others); Tue, 23 Aug 2022 05:49:37 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:52452 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352699AbiHWJqq (ORCPT ); Tue, 23 Aug 2022 05:46:46 -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 C9F2B18376; Tue, 23 Aug 2022 01:44: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 7153361499; Tue, 23 Aug 2022 08:44:16 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 76F02C433D6; Tue, 23 Aug 2022 08:44:15 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1661244255; bh=8x8a63ntKhqkoOD+w91XE3oumOK0E4SykLQt4bVGTB8=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=eqf4SPAge/TTiJ0RN+3M35lZU1FvrV+e/P8vwQwRKYgBEH/5e2kSPE9Swt0IkN5IV pCJ5gBnl/nNZhvy0kYZgptPu3ekuig7LUK3zgS5c8ItpnOMiuAlN//EGYoZkRlSq3n wlVX3c22psg6JnYhrQkR4MtFP7MdKXjx9HP0BB/M= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miaoqian Lin , Linus Walleij Subject: [PATCH 5.15 063/244] pinctrl: nomadik: Fix refcount leak in nmk_pinctrl_dt_subnode_to_map Date: Tue, 23 Aug 2022 10:23:42 +0200 Message-Id: <20220823080101.187795710@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220823080059.091088642@linuxfoundation.org> References: <20220823080059.091088642@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 @@ -1421,8 +1421,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;