Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3094633rwb; Mon, 15 Aug 2022 18:00:10 -0700 (PDT) X-Google-Smtp-Source: AA6agR52QwPqEO7ScNZsQazI+CtyhodPPdotnVHwHWRSaeYjimmS2JQE+7kQxSVch+FTk1BduQ7a X-Received: by 2002:a17:907:a056:b0:730:ce15:842d with SMTP id gz22-20020a170907a05600b00730ce15842dmr11962556ejc.275.1660611610278; Mon, 15 Aug 2022 18:00:10 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660611610; cv=none; d=google.com; s=arc-20160816; b=s6yrUkG2PmoCk0CIPMFXylOHSb9i4Ce7KqZdZpd9fpH0+u0h9dzEf7AFA/9XK1cCKz NUzh0XR2UGnRYm2kPXjwxlqN06lNT1uiXjrfYoY1S8s9VKmbHpS+h9QgAqMPovBv7DZ5 HlNMhfAAB9QnEUrSY7oW67A3iVs9vQpsnJF+VoRHXUFvDP69LRjNDkB8uK4v11pUCQ1o QE5jLVuaqUW0u2xr44BMaImPIXQkewnEhGX95VeVD+x7kPaYfhn7kzosCzio3lF50pGs z+Sw9PdryYE+V/MwFVuAzcPsJme5Xo5ZIbD47iRob9AzeVndQjX95S1wzabKgoIWMntR QSRw== 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=otzI1QM3juckosMCkABwhspM/wS++oNEQOqDCG/KTBU=; b=dqZXmZMFoSRxfdN/t9ZAwuM1164NrSOZRnHY3mJNY+Q7FquoXmlH3jaqo3ToCXaKxM xoz8pnv0HNdK0mSI2Pn9dTh3ZhS++JeUL4b2A34uWOCsWNZ6l+VXb5dBROwfqsvbrHJx 8Y7HvgUc7MuLgAcVXuVryTeoLb7sDsOhcgB+4ZVfi6JtQqaJ0dphjT66KI6xK+tiuo5u BzaAj/xsvTwrg4StOc8wU7LOaKCtGE4mcP+yL/Kp//+LIKVL4B+YpZfSeR2MxCrvWqty 9wHq5cM1QhtGIHM64jk8p3XDq5ZHN40cnAX8mbRet3Fscj7Cy3etexDMOC+oF2JvOWB4 JjFA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=LEjR55Il; 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 w14-20020a1709062f8e00b0072a9e62a9dfsi7546538eji.111.2022.08.15.17.59.38; Mon, 15 Aug 2022 18:00:10 -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=LEjR55Il; 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 S240639AbiHPAtd (ORCPT + 99 others); Mon, 15 Aug 2022 20:49:33 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:35450 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1347178AbiHPApw (ORCPT ); Mon, 15 Aug 2022 20:45:52 -0400 Received: from ams.source.kernel.org (ams.source.kernel.org [145.40.68.75]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 5AD18193574; Mon, 15 Aug 2022 13:41:38 -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 0DA4CB8119A; Mon, 15 Aug 2022 20:41:37 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 461D5C433D6; Mon, 15 Aug 2022 20:41:35 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660596095; bh=9aFWhDb0sLjSYCbmI8Iu1nyBKM24DyHPC+Y0uMpBoEI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=LEjR55Il+asskpd/9sIU0W9B1KLDQrP56qdFwTLpWCx1E/42aivOQCL7tkyDjaFA+ EpkyzdMn0ggT+glusqRhMYh7FPYGoR5kn1dl0b+AFrrOD2ubCHfkYsQmXIw1VAdOzR HnSctgnowdRGEgEmKanvffbTJbpAjXSqyNNEdaPM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miaoqian Lin , Krzysztof Kozlowski , Lee Jones , Sasha Levin Subject: [PATCH 5.19 0970/1157] mfd: max77620: Fix refcount leak in max77620_initialise_fps Date: Mon, 15 Aug 2022 20:05:26 +0200 Message-Id: <20220815180518.492866362@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180439.416659447@linuxfoundation.org> References: <20220815180439.416659447@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 1520669c8255bd637c6b248b2be910e2688d38dd ] of_get_child_by_name() 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: 327156c59360 ("mfd: max77620: Add core driver for MAX77620/MAX20024") Signed-off-by: Miaoqian Lin Reviewed-by: Krzysztof Kozlowski Signed-off-by: Lee Jones Link: https://lore.kernel.org/r/20220601043222.64441-1-linmq006@gmail.com Signed-off-by: Sasha Levin --- drivers/mfd/max77620.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/drivers/mfd/max77620.c b/drivers/mfd/max77620.c index fec2096474ad..a6661e07035b 100644 --- a/drivers/mfd/max77620.c +++ b/drivers/mfd/max77620.c @@ -419,9 +419,11 @@ static int max77620_initialise_fps(struct max77620_chip *chip) ret = max77620_config_fps(chip, fps_child); if (ret < 0) { of_node_put(fps_child); + of_node_put(fps_np); return ret; } } + of_node_put(fps_np); config = chip->enable_global_lpm ? MAX77620_ONOFFCNFG2_SLP_LPM_MSK : 0; ret = regmap_update_bits(chip->rmap, MAX77620_REG_ONOFFCNFG2, -- 2.35.1