summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorArnd Bergmann <arnd@arndb.de>2026-08-04 21:51:40 +0200
committerArnd Bergmann <arnd@arndb.de>2026-08-04 21:51:41 +0200
commit67be500fa08c713fe1cd9c4bd513cfca72042607 (patch)
treec4ee7d9b6b9e093869479883aedb1fd1e384dd5f
parent3a83c24d747b2700bd11990e9546a89a95275ea3 (diff)
parent6342de0aed216b6df460b492ddb532b3e0ed16f1 (diff)
Merge tag 'omap-for-v7.3/drivers-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-omap into soc/drivers
drivers: omap updates for v7.3 - bus: ti-sysc: Fix /chosen node reference leak * tag 'omap-for-v7.3/drivers-signed' of git://git.kernel.org/pub/scm/linux/kernel/git/khilman/linux-omap: bus: ti-sysc: Fix /chosen node reference leak Signed-off-by: Arnd Bergmann <arnd@arndb.de>
-rw-r--r--drivers/bus/ti-sysc.c12
1 files changed, 8 insertions, 4 deletions
diff --git a/drivers/bus/ti-sysc.c b/drivers/bus/ti-sysc.c
index a5b9507de37c..e118b900c9ac 100644
--- a/drivers/bus/ti-sysc.c
+++ b/drivers/bus/ti-sysc.c
@@ -682,6 +682,7 @@ static struct device_node *stdout_path;
static void sysc_init_stdout_path(struct sysc *ddata)
{
+ struct device_node *chosen;
struct device_node *np = NULL;
const char *uart;
@@ -691,15 +692,18 @@ static void sysc_init_stdout_path(struct sysc *ddata)
if (stdout_path)
return;
- np = of_find_node_by_path("/chosen");
- if (!np)
+ chosen = of_find_node_by_path("/chosen");
+ if (!chosen)
goto err;
- uart = of_get_property(np, "stdout-path", NULL);
- if (!uart)
+ uart = of_get_property(chosen, "stdout-path", NULL);
+ if (!uart) {
+ of_node_put(chosen);
goto err;
+ }
np = of_find_node_by_path(uart);
+ of_node_put(chosen);
if (!np)
goto err;