Message ID | 20220603121950.24422-1-linmq006@gmail.com |
---|---|
State | New |
Headers | show
Return-Path: <linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org> 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=Ol4sGLMY; 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=leCQRj2G; 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=<UNKNOWN>) 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 4LF2731dcHz9sFs for <incoming-imx@patchwork.ozlabs.org>; Fri, 3 Jun 2022 22:21:35 +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=ZCVO6uyh3K9SigixUXsqEpILbTgzdqFZ0kJdiE284KU=; b=Ol4sGLMYKOnsXe 0SWQdOzMfkAn1BafEiRSRrR4YfnPudfRmyCanqIan5dlt/Q5bOeOodbKdMG0dh36NO4CWPL8nIuQI z96bG4Sq62Ie1cvwTQ6ug3JRRNnyN+V0w0BIReQjLlKrWyjkDfNQTomD08bozJaLHww0y/B24xs2p Su8g1lejBdvNcnyLS2usdygaXgcMbk987Ml2eoTtufAK6DJlgdlhEyfZsVyk8HTFNulErS5HULd8T DYIo1KUCcTlP/XgCmYvNU2I27yxU0WBc4F5/ydj4os75fHweAXchnpzS91mXHKz02DJWVXKUkEaOX 9PYLjTd4/lvWIVzJLiYA==; Received: from localhost ([::1] helo=bombadil.infradead.org) by bombadil.infradead.org with esmtp (Exim 4.94.2 #2 (Red Hat Linux)) id 1nx6Ic-007O3k-35; Fri, 03 Jun 2022 12:21:06 +0000 Received: from mail-pj1-x1032.google.com ([2607:f8b0:4864:20::1032]) by bombadil.infradead.org with esmtps (Exim 4.94.2 #2 (Red Hat Linux)) id 1nx6Hb-007Nej-8M for linux-arm-kernel@lists.infradead.org; Fri, 03 Jun 2022 12:20:04 +0000 Received: by mail-pj1-x1032.google.com with SMTP id n13-20020a17090a394d00b001e30a60f82dso11928763pjf.5 for <linux-arm-kernel@lists.infradead.org>; Fri, 03 Jun 2022 05:20:01 -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=Fq2Ar1e2ZR5JL+WTMutSf70OTR0Z9U3rGO5z4u4hDlY=; b=leCQRj2GwhtOylMw1bAfwDMhy6jYfoPNNBT+/pC7WbhCEwkiwIB+kn3gcxTPMHoODi 4lxYLey53F2hBU31d1o+2My7iNvffZykNuGWBB5lKXJLO8Q0RLdwE9r42Wp7pwsYmijL yogb4eSJEa7Q1Zovhgca7xTZId2xmY+uh5gS/JnRVZtA52krzdvyrSlDzF1tMuaIbegv 0IvtgDfEeyfY5Fb9eyD1iWwgOBr5Pv68alCksoLJUX793m+c/YA8Dyd5bW5WTsAk0ETY vC3OXVLbnqIDdpop66aAEwof9cwOgFGDPBD6pz6wAxlHsSYjzX1Ufv2XhQ970yZoqK+O HGbQ== 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=Fq2Ar1e2ZR5JL+WTMutSf70OTR0Z9U3rGO5z4u4hDlY=; b=kJjtWFchmb6m1uEtMRyKinyZp2crHvtXXPUrWsu8Z+QW0XuQjEe4gN8r1lZsYslDgP Fhcawdzjf2hOErb4NuOI5565qG9kgpCfvz9dDPk3oB1Q8z5WJtJ73pzTngrcDARPhZPo 5PewZ4YrgSKLhbyHNdUz1F3++ok0YDRJfJlx7s/Olo1q+yoceNz5yFKLDYNASMYgONyl yHkX1z+nwOtPA5iVYu3U2W1Xq21CBmJyU9/U417pG0xiVIwR0es6D9xVpNEFJjk4bQBE f3xqFdzruraQqU7tUBW7eHxjSW6A61SEeiMewFC6ETQD30APnZpbYaZLB5IsHSYxmdq0 VS4A== X-Gm-Message-State: AOAM531UyDYwzUBL87aakba0qunLjw48HzAR1aQEnqKk4mxaIwhJcZ7F FKaZSwKbtUC6Av/SnJ0SqGQ= X-Google-Smtp-Source: ABdhPJxBYPtYCDgqbR6kISfLKqqf59ArnoO4o+YdZk3hIgGrcdmUvi5l49pGytbuVS7RPisd2T9M5g== X-Received: by 2002:a17:90b:38c4:b0:1e6:89f9:73da with SMTP id nn4-20020a17090b38c400b001e689f973damr8476735pjb.220.1654258801381; Fri, 03 Jun 2022 05:20:01 -0700 (PDT) Received: from localhost.localdomain ([202.120.234.246]) by smtp.googlemail.com with ESMTPSA id ju10-20020a17090b20ca00b001df264610c4sm5439385pjb.0.2022.06.03.05.19.56 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 03 Jun 2022 05:20:00 -0700 (PDT) From: Miaoqian Lin <linmq006@gmail.com> To: Russell King <linux@armlinux.org.uk>, Shawn Guo <shawnguo@kernel.org>, Sascha Hauer <s.hauer@pengutronix.de>, Pengutronix Kernel Team <kernel@pengutronix.de>, Fabio Estevam <festevam@gmail.com>, NXP Linux Team <linux-imx@nxp.com>, Miaoqian Lin <linmq006@gmail.com>, 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:19:48 +0400 Message-Id: <20220603121950.24422-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_052003_359796_54F67319 X-CRM114-Status: GOOD ( 11.47 ) 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: 2046338dcbc6 ("ARM: mxs: Use soc bus infrastructure") Signed-off-by: Miaoqian Lin --- changes in v2: - update Fixes tag. v1 Link: --- arch/arm/mach-mxs/mach-mxs.c | 1 + 1 file changed, 1 in [...] 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:1032 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: <linux-arm-kernel.lists.infradead.org> List-Unsubscribe: <http://lists.infradead.org/mailman/options/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=unsubscribe> List-Archive: <http://lists.infradead.org/pipermail/linux-arm-kernel/> List-Post: <mailto:linux-arm-kernel@lists.infradead.org> List-Help: <mailto:linux-arm-kernel-request@lists.infradead.org?subject=help> List-Subscribe: <http://lists.infradead.org/mailman/listinfo/linux-arm-kernel>, <mailto:linux-arm-kernel-request@lists.infradead.org?subject=subscribe> Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: 7bit Sender: "linux-arm-kernel" <linux-arm-kernel-bounces@lists.infradead.org> Errors-To: linux-arm-kernel-bounces+incoming-imx=patchwork.ozlabs.org@lists.infradead.org |
Series |
ARM: mxs: Fix refcount leak in mxs_machine_init
|
expand
|
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;
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: 2046338dcbc6 ("ARM: mxs: Use soc bus infrastructure") Signed-off-by: Miaoqian Lin <linmq006@gmail.com> --- changes in v2: - update Fixes tag. v1 Link: https://lore.kernel.org/r/20220603120314.15488-1-linmq006@gmail.com --- arch/arm/mach-mxs/mach-mxs.c | 1 + 1 file changed, 1 insertion(+)