Received: by 2002:a05:6358:4e97:b0:b3:742d:4702 with SMTP id ce23csp1875821rwb; Fri, 19 Aug 2022 10:53:04 -0700 (PDT) X-Google-Smtp-Source: AA6agR6kKYpes+o3NwcIWHlWu/S2fw3UxVMwSySyYLZyzrrLBWjOjJJFKZ0CndtbMlxb/MKTNWsy X-Received: by 2002:a05:6402:2816:b0:434:ed38:16f3 with SMTP id h22-20020a056402281600b00434ed3816f3mr6890770ede.116.1660931584164; Fri, 19 Aug 2022 10:53:04 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1660931584; cv=none; d=google.com; s=arc-20160816; b=LmG9Zk4J0tkByCgyR9Gxzjjl/Miiuh/NGMaOQUSJXvRO4nJMqQ0Kh/m6NSYqWz/nG0 EFNKbiBsxbdgbDB/NAs8SdjPk0KvcIS307qV4E8U/pcYZ7dtt7H8/3d+ZyetQHgviU1e T/Ccbu//xk/srczE+uLDK87/xXbvxaW0lgbcmFErmJ0legfIkmPEaOpfCuRyMGKWUWXP 0fP3sNmECimcC5CYlukiGvtnOSFVFdeDUu1e/8d/xmgSat9R1W8+Hav/o5ZcA4JLcpsQ vPujwRH0JiAhYx1U9/QtJBcTvENj9ZZGrysvJoQa0WDxoIb4jQp2oWPbZv6c80bwq2Zg GKCQ== 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=ZtOnvYGl/Y3MR4W7xuM9614vumU7h1BzZrT+oNwi8tw=; b=X9eFqpucwcc22H8wnWl7B12LSK3ArS8LqveJNpLQBCHPTgSUFm0Ybzlpm31yuLsxaU bhtbYD6GFcQRjghhr27pCXXpKTj5Bi7uazFHz98mSjP4Y10qlCgB/q6f4sMuq+V3CTzo B96tViN+n5HYmOva8tl/lWJ4q4hFxON0AvDG9WDHEghydkV8TxdyPhLdgU4c3bbmiv7R s+FCF6PBikoFHGcpkr3xHOBDNDcRFsZEon0wmHrUQWl+XuXNpxN5GcP7orYYby5poKNq KYWrZItIuP9N0eE2YqFCldQMFgjel/wXNnGB8//OnUGcxCykqwsjpytyQGKnfEGyts7/ K8qA== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@linuxfoundation.org header.s=korg header.b=PgzGZuug; 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 sh16-20020a1709076e9000b0072ee922047asi3933034ejc.590.2022.08.19.10.52.37; Fri, 19 Aug 2022 10:53:04 -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=PgzGZuug; 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 S1350858AbiHSP62 (ORCPT + 99 others); Fri, 19 Aug 2022 11:58:28 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:41116 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1350958AbiHSP4G (ORCPT ); Fri, 19 Aug 2022 11:56:06 -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 853F230F6E; Fri, 19 Aug 2022 08:50:58 -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 C17D7615E7; Fri, 19 Aug 2022 15:50:57 +0000 (UTC) Received: by smtp.kernel.org (Postfix) with ESMTPSA id C78D2C433C1; Fri, 19 Aug 2022 15:50:56 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=linuxfoundation.org; s=korg; t=1660924257; bh=YhgF2yt0u3VyqWuFgGE9+OCvXB5d0Chiy9PsctpcyxA=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PgzGZuugVsQ/KxB6f6/bPvQ57Ga8OnXRIwnn6sZ412tXOloY9pGTzQ8A+aRwpiztG zkjXJWQgaqlgobFZ0m3yXqGafYOFpoutvoJ8UO2QOq9mAEGNAmxCs/rKfirTDV5t6o p/h59RWGWQ6e+A7xqY7Buah0YWFhGvCSmIaq5PVM= From: Greg Kroah-Hartman To: linux-kernel@vger.kernel.org Cc: Greg Kroah-Hartman , stable@vger.kernel.org, Miaoqian Lin , Martin Blumenstingl , Neil Armstrong , Sasha Levin Subject: [PATCH 5.10 109/545] meson-mx-socinfo: Fix refcount leak in meson_mx_socinfo_init Date: Fri, 19 Aug 2022 17:37:59 +0200 Message-Id: <20220819153834.168000884@linuxfoundation.org> X-Mailer: git-send-email 2.37.2 In-Reply-To: <20220819153829.135562864@linuxfoundation.org> References: <20220819153829.135562864@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 a2106f38077e78afcb4bf98fdda3e162118cfb3d ] of_find_matching_node() 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: 5e68c0fc8df8 ("soc: amlogic: Add Meson6/Meson8/Meson8b/Meson8m2 SoC Information driver") Signed-off-by: Miaoqian Lin Reviewed-by: Martin Blumenstingl Signed-off-by: Neil Armstrong Link: https://lore.kernel.org/r/20220524065729.33689-1-linmq006@gmail.com Signed-off-by: Sasha Levin --- drivers/soc/amlogic/meson-mx-socinfo.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/soc/amlogic/meson-mx-socinfo.c b/drivers/soc/amlogic/meson-mx-socinfo.c index 78f0f1aeca57..92125dd65f33 100644 --- a/drivers/soc/amlogic/meson-mx-socinfo.c +++ b/drivers/soc/amlogic/meson-mx-socinfo.c @@ -126,6 +126,7 @@ static int __init meson_mx_socinfo_init(void) np = of_find_matching_node(NULL, meson_mx_socinfo_analog_top_ids); if (np) { analog_top_regmap = syscon_node_to_regmap(np); + of_node_put(np); if (IS_ERR(analog_top_regmap)) return PTR_ERR(analog_top_regmap); -- 2.35.1