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 B55A578C9C; Sat, 12 Sep 2026 14:39:52 +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=1789223993; cv=none; b=deWiAPHtVddvrJz3tuRfoagHxeVuauVapS4U6ZkNZgSG7H66Pm8rBeVgWlPwSj3KNS9CJ1v/Xf1GWBkZr9ixUnIwGuXy4uFZXklVr0/HBMDYsrDfgcJcFiz+1P33iJM/+C48PRnjfBVXzjiCRIgvy9xt6/TK2wq2HwXY6CMk/Is= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1789223993; c=relaxed/simple; bh=cMnfKXXbrNoGv2HpFYz2pVxxl7ByjroTq0fStWOCiUs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=WlBfht+LSFAVgCUJ/ZH4ltCtntE32hxLZfTxplmSSF4RQUqm633ygTPIQY4rk4KPZ4geXPuFoeMiTPoLzYjixWUj5xEOd7JgCpFsw89n8EBI0nR4F1kJ6SeyzKcb1KkgLKZK13Qa2DrPDHSUA/LhU5/0wyOhVZxrJN3Vg6lIjRE= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (1024-bit key) header.d=linuxfoundation.org header.i=@linuxfoundation.org header.b=dbhrj68A; 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="dbhrj68A" Received: by smtp.kernel.org (Postfix) with ESMTPSA id 4DE151F000FF; Sat, 12 Sep 2026 14:39:51 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linuxfoundation.org; s=korg; t=1789223992; bh=4P9sYjBiPczS87lmCAnhWaqwBI+SbpQ3jilZieTnBPw=; h=From:To:Cc:Subject:Date:In-Reply-To:References; b=dbhrj68AF4Y2F39sKEKC27h4UbDRyvaQt+hRnty4ok7aystUpQfR0MCQJ+3ttj4rK heiU27fm2INeA2N6edOn6f1RoIf2fJDAV9FIMvEzwwWcALEJngdVfhOB76iuicPnXR EHYKi5pfK7nMGLxn/n5FhAPibX0FsKjGkGlhcibQ= From: Greg Kroah-Hartman To: stable@vger.kernel.org Cc: Greg Kroah-Hartman , patches@lists.linux.dev, Guangshuo Li , Brian Masney , Sasha Levin Subject: [PATCH 6.6 0900/1424] clk: tegra: tegra124-emc: put EMC node on register failure Date: Sat, 12 Sep 2026 08:55:32 +0200 Message-ID: <20260912065627.481312783@linuxfoundation.org> X-Mailer: git-send-email 2.55.0 In-Reply-To: <20260912065607.279695368@linuxfoundation.org> References: <20260912065607.279695368@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 6.6-stable review patch. If anyone has any objections, please let me know. ------------------ From: Guangshuo Li [ Upstream commit f726279f5eab813f9a8b6f38ddf2a4b062d038ff ] tegra124_clk_register_emc() stores a device node reference returned by of_parse_phandle() in tegra->emc_node. If clk_register() fails, the function returns an error before that reference can be consumed and released by the normal runtime path. The tegra_clk_emc object is freed on this failure path, but freeing the object does not drop the OF node reference stored in it. Drop the EMC node reference before freeing the tegra_clk_emc object. of_node_put() is safe for a NULL node, so this also covers the case where the phandle is absent. Fixes: 2db04f16b589 ("clk: tegra: Add EMC clock driver") Signed-off-by: Guangshuo Li Reviewed-by: Brian Masney Signed-off-by: Brian Masney Signed-off-by: Sasha Levin --- drivers/clk/tegra/clk-tegra124-emc.c | 1 + 1 file changed, 1 insertion(+) diff --git a/drivers/clk/tegra/clk-tegra124-emc.c b/drivers/clk/tegra/clk-tegra124-emc.c index 5f1af6dfe7154..674aef2785394 100644 --- a/drivers/clk/tegra/clk-tegra124-emc.c +++ b/drivers/clk/tegra/clk-tegra124-emc.c @@ -539,6 +539,7 @@ struct clk *tegra124_clk_register_emc(void __iomem *base, struct device_node *np clk = clk_register(NULL, &tegra->hw); if (IS_ERR(clk)) { + of_node_put(tegra->emc_node); kfree(tegra); return clk; } -- 2.53.0