[PATCH] memory: tegra: fix device_node leak in tegra186_mc_probe_device()

Selby Mashiki posted 1 patch 3 weeks, 5 days ago
drivers/memory/tegra/tegra186.c | 1 +
1 file changed, 1 insertion(+)
[PATCH] memory: tegra: fix device_node leak in tegra186_mc_probe_device()
Posted by Selby Mashiki 3 weeks, 5 days ago
tegra186_mc_probe_device() iterates over the "interconnects" phandles
using of_parse_phandle_with_args(), which increments the reference count
of args.np on each successful call, but never drops the reference with
of_node_put(args.np).

Call of_node_put(args.np) at the end of each loop iteration.

Fixes: fe3b082a6eb8 ("memory: tegra: Add SID override programming for MC clients")
Signed-off-by: Selby Mashiki <mashikiselby@gmail.com>
---
 drivers/memory/tegra/tegra186.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/drivers/memory/tegra/tegra186.c b/drivers/memory/tegra/tegra186.c
index 442edb2b0..0df5b5658 100644
--- a/drivers/memory/tegra/tegra186.c
+++ b/drivers/memory/tegra/tegra186.c
@@ -146,6 +146,7 @@ static int tegra186_mc_probe_device(struct tegra_mc *mc, struct device *dev)
 			}
 		}
 
+		of_node_put(args.np);
 		index++;
 	}
 #endif
-- 
2.56.0
Re: [PATCH] memory: tegra: fix device_node leak in tegra186_mc_probe_device()
Posted by Krzysztof Kozlowski 2 weeks, 6 days ago
On Sun, 25 Oct 2026 21:03:22 +0200, Selby Mashiki wrote:
> tegra186_mc_probe_device() iterates over the "interconnects" phandles
> using of_parse_phandle_with_args(), which increments the reference count
> of args.np on each successful call, but never drops the reference with
> of_node_put(args.np).
> 
> Call of_node_put(args.np) at the end of each loop iteration.
> 
> [...]

Applied, thanks!

[1/1] memory: tegra: fix device_node leak in tegra186_mc_probe_device()
      https://git.kernel.org/krzk/linux-mem-ctrl/c/3de6a98362e7c833ba78f5928890744ca9187cdc

Best regards,
-- 
Krzysztof Kozlowski <krzk@kernel.org>