From patchwork Fri Jun 3 12:03:13 2022 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Miaoqian Lin X-Patchwork-Id: 1638707 Return-Path: X-Original-To: incoming-imx@patchwork.ozlabs.org Delivered-To: patchwork-incoming-imx@bilbo.ozlabs.org Authentication-Results: bilbo.ozlabs.org; dkim=pass (2048-bit key; secure) header.d=lists.infradead.org header.i=@lists.infradead.org header.a=rsa-sha256 header.s=bombadil.20210309 header.b=XhCMAL0Z; dkim=fail reason="signature verification failed" (2048-bit key; unprotected) header.d=gmail.com header.i=@gmail.com header.a=rsa-sha256 header.s=20210112 header.b=HE1wDncs; dkim-atps=neutral Authentication-Results: ozlabs.org; spf=none (no SPF record) smtp.mailfrom=lists.infradead.org (client-ip=2607:7c80:54:3::133; helo=bombadil.infradead.org; envelope-from=linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org; receiver=) Received: from bombadil.infradead.org (bombadil.infradead.org [IPv6:2607:7c80:54:3::133]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by bilbo.ozlabs.org (Postfix) with ESMTPS id 4LF1kW0rxhz9s09 for ; Fri, 3 Jun 2022 22:03:47 +1000 (AEST) DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=lists.infradead.org; s=bombadil.20210309; h=Sender: Content-Transfer-Encoding:Content-Type:List-Subscribe:List-Help:List-Post: List-Archive:List-Unsubscribe:List-Id:MIME-Version:Message-Id:Date:Subject:To :From:Reply-To:Cc:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:In-Reply-To:References: List-Owner; bh=qBMnbkQwIVNtswYjiMxLFULmV+aTtY8j/rLjpUN2pHM=; b=XhCMAL0ZrY0xzO uf/7U/pY9c+UopACusoEmwXhBUyk5b+Sa9fFOCJlhMd5WiXr6MvhtS67y4VtbCAhjoXwWAJDMtYca 218ySEFznndzmHDyRajqJt1xYX65vzr/puKQW80HTxzhds5E6VMaoRcaERQfqlyc0i4rnJz9L1x2x p9V48lNTKZ71Ye/xmZCjOfMo3mC5tfc25cn3QkKaHngRM8LOnZqQlEsdnirSzdTJBvKZHQwcgiBYo aj4v+/BJt4ILPw3/XEUGNMDhYy5j5rw7WGbX02XBygpHjGYP5NmtGyIh3XmqSJoqSl5xgNUI7y1dm 56FL84Q1U7FGnzEjvWAA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nx61b-007Iwf-9I; Fri, 03 Jun 2022 12:03:31 +0000 Received: from mail-pl1-x634.google.com ([2607:f8b0:4864:20::634]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nx61Y-007IvU-4G for linux-arm-kernel@lists.infradead.org; Fri, 03 Jun 2022 12:03:29 +0000 Received: by mail-pl1-x634.google.com with SMTP id o17so6700561pla.6 for ; Fri, 03 Jun 2022 05:03:24 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20210112; h=from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=qAU9VOHgii5Wb5QPt822QV/PI4uIiJFGRJit8v42VVY=; b=HE1wDncs7+sayb1iTW06qw8e76iV+Xe7y7LA94M8Dywn4ywXB+lBy/II4PB9rZkvGK ukEi89hqX/q02lORaYDIEkulxGmc3G4ww9Gyzaj9kgZA0SfJb29lm6wSvWASPzjYB7lM KPKJiAKkI7N+iYsBgV5aL7WzwQKSiYX9T+QThNygRMQZY65w9i7VOA4P22k1E4Uroujy 6S8nXtz+PMxQI9UdpYrTYnkIzXqF4eVWalTTaFLCs/FrYUWyWzByAi6071dzej3LFUlp I4A97GWtzZkD725KyAwbxG+6Q151bgMzVH22W5tcYhRjEowp08aeW9ISyUF/63i1hnXW uFVQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20210112; h=x-gm-message-state:from:to:subject:date:message-id:mime-version :content-transfer-encoding; bh=qAU9VOHgii5Wb5QPt822QV/PI4uIiJFGRJit8v42VVY=; b=PllFfyIqSpXd4aIC2vbC/VAIfLvbvshlKyneticzuI3270BkByhCP4LI1326dqasvA BF9kR8Es901+ARiyeWCNGzkngZey7TcBQAFGaa//F02krAN5Eg+uZ04TkgEEZ1Lau45t uN1aOh7r2VFarqZMMlveFqhuWsybdrV+eTcNLaziJ+y4N/RiFFmhhSSr993Z7H5YdFEt z32RwVFPB+S9Gb6/8bh6VLEUHjoe+dYtUH4OLfCcd4/fUmXMLAPCwevmVH8MHfy5VtZT bNafLljuOvVz3R2lmBOlH91vGg3s5Q1u8G1w17j/WLj9bLvG8/VWoOSE/oreslLFHRGQ uwAA== X-Gm-Message-State: AOAM531Jyug0qej70rcE8xowNLdpmm7NxL+s5t7BOmwUzHMdT02XUHjt qpZY0+4qVOzo4PCDzxKfjT4= X-Google-Smtp-Source: ABdhPJy4N3lyqqdqLOfVkBBotTfzO18+RUMzodGioUIYhBafR7dVEREOJAMPpEhPxRQpHdCr+5dqNg== X-Received: by 2002:a17:90a:7349:b0:1dc:9314:8699 with SMTP id j9-20020a17090a734900b001dc93148699mr46128313pjs.184.1654257804023; Fri, 03 Jun 2022 05:03:24 -0700 (PDT) Received: from localhost.localdomain ([202.120.234.246]) by smtp.googlemail.com with ESMTPSA id kw3-20020a17090b220300b001e2f6c7b6f6sm5008486pjb.10.2022.06.03.05.03.19 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jun 2022 05:03:23 -0700 (PDT) From: Miaoqian Lin To: Russell King , Shawn Guo , Sascha Hauer , Pengutronix Kernel Team , Fabio Estevam , NXP Linux Team , Miaoqian Lin , linux-arm-kernel@lists.infradead.org, linux-kernel@vger.kernel.org Subject: [PATCH] ARM: mxs: Fix refcount leak in mxs_machine_init Date: Fri, 3 Jun 2022 16:03:13 +0400 Message-Id: <20220603120314.15488-1-linmq006@gmail.com> X-Mailer: git-send-email 2.25.1 MIME-Version: 1.0 X-CRM114-Version: 20100106-BlameMichelson ( TRE 0.8.0 (BSD) ) MR-646709E3 X-CRM114-CacheID: sfid-20220603_050328_183908_A91988FC X-CRM114-Status: GOOD ( 11.27 ) X-Spam-Score: 0.1 (/) X-Spam-Report: Spam detection software, running on the system "bombadil.infradead.org", has NOT identified this incoming email as spam. The original message has been attached to this so you can view it or label similar future email. If you have any questions, see the administrator of that system for details. Content preview: of_find_node_by_path() returns remote device nodepointer with refcount incremented, we should use of_node_put() on it when done. Add missing of_node_put() to avoid refcount leak. Fixes: format:2046338dcbc6 ("ARM: mxs: Use soc bus infrastructure") Signed-off-by: Miaoqian Lin --- arch/arm/mach-mxs/mach-mxs.c | 1 + 1 file changed, 1 insertion(+) Content analysis details: (0.1 points, 5.0 required) pts rule name description ---- ---------------------- -------------------------------------------------- -0.0 RCVD_IN_DNSWL_NONE RBL: Sender listed at https://www.dnswl.org/, no trust [2607:f8b0:4864:20:0:0:0:634 listed in] [list.dnswl.org] -0.0 SPF_PASS SPF: sender matches SPF record 0.0 SPF_HELO_NONE SPF: HELO does not publish an SPF Record 0.0 FREEMAIL_FROM Sender email is commonly abused enduser mail provider [linmq006[at]gmail.com] 0.2 FREEMAIL_ENVFROM_END_DIGIT Envelope-from freemail username ends in digit [linmq006[at]gmail.com] -0.1 DKIM_VALID_AU Message has a valid DKIM or DK signature from author's domain -0.1 DKIM_VALID Message has at least one valid DKIM or DK signature 0.1 DKIM_SIGNED Message has a DKIM or DK signature, not necessarily valid -0.1 DKIM_VALID_EF Message has a valid DKIM or DK signature from envelope-from domain X-BeenThere: linux-arm-kernel@lists.infradead.org X-Mailman-Version: 2.1.34 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: "linux-arm-kernel" Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org of_find_node_by_path() returns remote device nodepointer with refcount incremented, we should use of_node_put() on it when done. Add missing of_node_put() to avoid refcount leak. Fixes: format:2046338dcbc6 ("ARM: mxs: Use soc bus infrastructure") Signed-off-by: Miaoqian Lin --- arch/arm/mach-mxs/mach-mxs.c | 1 + 1 file changed, 1 insertion(+) diff --git a/arch/arm/mach-mxs/mach-mxs.c b/arch/arm/mach-mxs/mach-mxs.c index 25c9d184fa4c..7d957cadd3e9 100644 --- a/arch/arm/mach-mxs/mach-mxs.c +++ b/arch/arm/mach-mxs/mach-mxs.c @@ -393,6 +393,7 @@ static void __init mxs_machine_init(void) root = of_find_node_by_path("/"); ret = of_property_read_string(root, "model", &soc_dev_attr->machine); + of_node_put(root); if (ret) return;