Skip to contentSkip to conversation

memory: tegra: fix device_node leak in tegra186_mc_probe_device()

PATCH Applied Selby Mashiki 2 participants 2 messages Oct 25 – Oct 31

Subsystems (2)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 memory: tegra: fix device_node leak in tegra186_mc_probe_device()

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")
---
 drivers/memory/tegra/tegra186.c | 1 +
 1 file changed, 1 insertion(+)
drivers/memory/tegra/tegra186.c +1 -0
index 442edb2b0..0df5b5658 100644
@@ -146,6 +146,7 @@ static int tegra186_mc_probe_device(struct tegra_mc *mc, struct device *dev)
 			}
 		}
 
+		of_node_put(args.np);
 		index++;
 	}
 #endif
Signature · 1 line
2.56.0
maintainer Applied
#1 lore raw
Quoted 8 lines · Selby Mashiki

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,

Signature · 1 line
Krzysztof Kozlowski <[email protected]>