Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp3030837rwb; Mon, 15 Aug 2022 16:30:04 -0700 (PDT) X-Google-Smtp-Source: AA6agR679VRSyLmDFjQ7ijIr1qGPXXFhkMVQ3XI/QRqn0ByzjlGoWpCWOwAQMB+9mPT0lGlKPrsM X-Received: by 2002:a17:907:2e01:b0:731:1eb0:b9ff with SMTP id ig1-20020a1709072e0100b007311eb0b9ffmr11733565ejc.728.1660606203861; Mon, 15 Aug 2022 16:30:03 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660606203; cv=none; d=google.com; s=arc-20160816; b=YMLDIY5ibcgZoN1jKuITNYupCuTVIL3hfWjvo3trBL7LMouytH1yBpCjhqvDSB/RHe D4Mvn0RDsg/FwmbkOlAmRdKp82pG2tzU+2In6nV6fmdli2sVKuP83uVQI5ZdpchyvArv 956/K4G7jbZ1LKz3MruN9FLp3nYJBynVfWN+FtXRFQB1tZfvCtMjbJmlv/4iZs9b3el/ a96XdvszmOv+gOpeQOndLbK0OZswOCZj9lkLeGF8xkpvdAvqYV+Nhc5JC4NZlcXakC9y q/kjPmyvduLzd3lZ04pZRHTg+L3enhBvogGY/oHiK8B4h/+5dfyg5uOJW1sNz/Zbd3bZ yzUw== 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=XpjGgmCyJdt+sh/JM3Osqm2/lq1JTu9yoQKVtuW+deNtzibDP+sTzqAy5p1ME6wB6Y +Yeq3ozfSfeRW/xyg5f8I307amg20f0+uvjF/RGjdgt4aHhL7ilpWHcGHiX/poaz+y5E ndUbWh7fgTZfG4UunDz6RCATFkoFfnxMrYXgl/67VUx5r/+5l4Nbazwvy35KIKVyzJSL E55H9VN5Mr8ASPLbWDYD/JVzRKeYW86qkHN5r2wlyZHmWYbC1UIpftI/wD7OOgK8aWEC iebgfoq5REYVuBmIyjE34uNSp6nSwjpQCKs1HS+ziIHkPfCoAULQyKKkRYFV9JRzYA4Z 31TQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=zHgz+qkJ; 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 x7-20020a056402414700b0043d10cc3a66si8046130eda.403.2022.08.15.16.29.23; Mon, 15 Aug 2022 16:30:03 -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=zHgz+qkJ; 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 S245367AbiHOWyL (ORCPT + 99 others); Mon, 15 Aug 2022 18:54:11 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:32798 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1352512AbiHOWwD (ORCPT ); Mon, 15 Aug 2022 18:52:03 -0400 Received: from dfw.source.kernel.org (dfw.source.kernel.org [139.178.84.217]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 9FDE91394FF; Mon, 15 Aug 2022 12:54:34 -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 2F3AE6113B; Mon, 15 Aug 2022 19:54:33 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id 20DCEC433C1; Mon, 15 Aug 2022 19:54:31 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660593272; bh=9aFWhDb0sLjSYCbmI8Iu1nyBKM24DyHPC+Y0uMpBoEI=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=zHgz+qkJCKeKJyZygYVayTKf2vekCx4q/8YNdTAqMo61SjtAYkSKCBGwuqCksf8Kh Ufun0Pw+UN/S0+23hEzzznzwT8FEovNkW2wDKmwH4aoRgqkQ/PoxOj3VehS5yQ0Pzm vaMcl7g/7E/3FS8KN/LFkzTvKlUOp61gHg+BCJ1E= 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.18 0894/1095] mfd: max77620: Fix refcount leak in max77620_initialise_fps Date: Mon, 15 Aug 2022 20:04:53 +0200 Message-Id: <20220815180506.311693811@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220815180429.240518113@linuxfoundation.org> References: <20220815180429.240518113@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