From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id DB526347515; Wed, 20 May 2026 18:17:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779301065; cv=none; b=kHwbOzP8u3bd75Zgo+P0S5yqFmd7zSa+f3vxH9EM1hRzcNEcD4vrAyDWNIvABJ531x+6xZ/QjsoCZi10FxLhvcWpJ52Wd3IIigt/ruagUhc+p7NHi9HXS4p6whsmYA34e/f2+tPAScq9to0YzjAsU1l0wm98gcMuokq06YsexzE= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779301065; c=relaxed/simple; bh=LehAEnhg+Kouh2lJHLaUvaBMtWKihR6wj5XjhUeq2n8=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=pGdUrpviLmCYPuzbLt6UGLYlWHL2rjtasLZnhtfj2muu3n8fErh44m2QpL1j/+fGZp+I2kqdXmoAJUa8yTpJYueu3uaVIzlS5+surwFcGLSlZXQUgtFZFeqrn6zQnbP7VIn+DP/zEKxMC+Ph12KLUWzCRwnQawAnjBjNWtjKM20= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=nzO785z7; arc=none smtp.client-ip=100.103.45.18 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b="nzO785z7" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4C7F91F000E9; Wed, 20 May 2026 18:17:44 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1779301064; bh=kxBpxTHIcZ1isnUncyTjo55Do2AtCp87OPajGwMXnW4=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=nzO785z7sh7y0EBvF/8ZbK3mb5xItnNnYFKzRlcX92Ozkusf4TxOuyT7Xl6MW7c0F eU3Ende8EbZDEfmxbPN9gF9sRiqSrq+0naeOk1TxPr6aqv2d/Pljk4WMipkRuKledx 3OReI32a8Sv02P2oPO0lWXX8vkBKLrfdOX50a2oQ= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Felix Gu , Frank Li , Peng Fan , Abel Vesa , Sasha Levin Subject: [PATCH 6.12 413/666] clk: imx: imx6q: Fix device node reference leak in of_assigned_ldb_sels() Date: Wed, 20 May 2026 18:20:24 +0200 Message-ID: <20260520162120.214864744@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260520162111.222830634@linuxfoundation.org> References: <20260520162111.222830634@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 6.12-stable review patch. If anyone has any objections, please let me know. ------------------ From: Felix Gu [ Upstream commit 9faf207208951460f3f7eefbc112246c8d28ff1b ] The function of_assigned_ldb_sels() calls of_parse_phandle_with_args() but never calls of_node_put() to release the reference, causing a memory leak. Fix this by adding proper cleanup calls on all exit paths. Fixes: 5d283b083800 ("clk: imx6: Fix procedure to switch the parent of LDB_DI_CLK") Signed-off-by: Felix Gu Reviewed-by: Frank Li Reviewed-by: Peng Fan Link: https://patch.msgid.link/20260203-clk-imx6q-v3-2-6cd2696bb371@gmail.com Signed-off-by: Abel Vesa Signed-off-by: Sasha Levin --- drivers/clk/imx/clk-imx6q.c | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/drivers/clk/imx/clk-imx6q.c b/drivers/clk/imx/clk-imx6q.c index ba696cf34fe3b..048e2ddba490b 100644 --- a/drivers/clk/imx/clk-imx6q.c +++ b/drivers/clk/imx/clk-imx6q.c @@ -188,9 +188,11 @@ static void of_assigned_ldb_sels(struct device_node *node, } if (clkspec.np != node || clkspec.args[0] >= IMX6QDL_CLK_END) { pr_err("ccm: parent clock %d not in ccm\n", index); + of_node_put(clkspec.np); return; } parent = clkspec.args[0]; + of_node_put(clkspec.np); rc = of_parse_phandle_with_args(node, "assigned-clocks", "#clock-cells", index, &clkspec); @@ -198,9 +200,11 @@ static void of_assigned_ldb_sels(struct device_node *node, return; if (clkspec.np != node || clkspec.args[0] >= IMX6QDL_CLK_END) { pr_err("ccm: child clock %d not in ccm\n", index); + of_node_put(clkspec.np); return; } child = clkspec.args[0]; + of_node_put(clkspec.np); if (child != IMX6QDL_CLK_LDB_DI0_SEL && child != IMX6QDL_CLK_LDB_DI1_SEL) -- 2.53.0