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 ABA203E95A4; Wed, 20 May 2026 16:57:11 +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=1779296232; cv=none; b=G5Edm5PJ59gHQUQrL2+LdSExFG68xOp43uqo88gD6FafCsCiuLaziU3haOjt3poGy8azZSIMFIjULkgn/7crggufapYzrwWHt33+MNF0b5N39EO3NFRZ1MHt5bWN6aNdkws7+DPDxNE22Fq8k2+Fh2duxMy0edE0k03HQ966D6g= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1779296232; c=relaxed/simple; bh=IlnO+jQ3CgT2Qlsrondo2atbc4yE8tnDSUIbQLIBoow=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=mfZvPp6hJAuHd+c36A6SIJknNKCZEFa0R9f2QHLcCKyK4X1blfn5QjUo5De84fVWMy7gRujtER1lLQ7B4iUPocp9VDAEYnxOor1GBk1BEBKacAXPhwmgzO5kjiqgrwrVErrAE7NhvhfFYP7SiKLh2VPP7lbuxKlXtfJGXzqEY48= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=rmgo5FA5; 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="rmgo5FA5" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 1BCA21F000E9; Wed, 20 May 2026 16:57:10 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1779296231; bh=2hr36skY3NkXXTzMzx+K/ZZLyJ90oNWhaec7WotU7Lg=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=rmgo5FA52QFldqMGCWiwa19+RUTkg2bzdgpiRf+eCY1CpVHwf07zAl5K8mpdjlDFC h+LYTYjVVZ/+yhRPpFeI57UmhZaDAqGtplfYUZ600RZfSZqmVmXpeAap08e5uPKpDr A//zBiuFJqgCqYvJTbV6y144oT3ubJhjL/kpZOZg= 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 7.0 0720/1146] clk: imx: imx6q: Fix device node reference leak in pll6_bypassed() Date: Wed, 20 May 2026 18:16:10 +0200 Message-ID: <20260520162204.498685815@linuxfoundation.org> X-Mailer: git-send-email 2.54.0 In-Reply-To: <20260520162148.390695140@linuxfoundation.org> References: <20260520162148.390695140@linuxfoundation.org> User-Agent: quilt/0.69 X-stable: review X-Patchwork-Hint: ignore Precedence: bulk X-Mailing-List: patches@lists.linux.dev List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit 7.0-stable review patch. If anyone has any objections, please let me know. ------------------ From: Felix Gu [ Upstream commit 4b84d496c804b470124cd3a08e928df6801d8eae ] The function pll6_bypassed() 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: 3cc48976e9763 ("clk: imx6q: handle ENET PLL bypass") Signed-off-by: Felix Gu Reviewed-by: Frank Li Reviewed-by: Peng Fan Link: https://patch.msgid.link/20260203-clk-imx6q-v3-1-6cd2696bb371@gmail.com Signed-off-by: Abel Vesa Signed-off-by: Sasha Levin --- drivers/clk/imx/clk-imx6q.c | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) diff --git a/drivers/clk/imx/clk-imx6q.c b/drivers/clk/imx/clk-imx6q.c index f726c00aba721..5549ef6c31173 100644 --- a/drivers/clk/imx/clk-imx6q.c +++ b/drivers/clk/imx/clk-imx6q.c @@ -238,8 +238,11 @@ static bool pll6_bypassed(struct device_node *node) return false; if (clkspec.np == node && - clkspec.args[0] == IMX6QDL_PLL6_BYPASS) + clkspec.args[0] == IMX6QDL_PLL6_BYPASS) { + of_node_put(clkspec.np); break; + } + of_node_put(clkspec.np); } /* PLL6 bypass is not part of the assigned clock list */ @@ -249,6 +252,9 @@ static bool pll6_bypassed(struct device_node *node) ret = of_parse_phandle_with_args(node, "assigned-clock-parents", "#clock-cells", index, &clkspec); + if (!ret) + of_node_put(clkspec.np); + if (clkspec.args[0] != IMX6QDL_CLK_PLL6) return true; -- 2.53.0