summaryrefslogtreecommitdiff
path: root/drivers/soc/tegra
diff options
context:
space:
mode:
authorLiang He <windhl@126.com>2022-06-15 15:32:32 +0300
committerThierry Reding <treding@nvidia.com>2022-09-15 13:38:43 +0300
commit0a3c2dbec425b82d9af7aeb5dc9b18da398992a7 (patch)
tree4de7559b9b1e7200cfd7fa6dc3c3aeb682b9761e /drivers/soc/tegra
parente941712cccab8a96f03b5d3274159c1ed338efee (diff)
downloadlinux-0a3c2dbec425b82d9af7aeb5dc9b18da398992a7.tar.xz
soc/tegra: fuse: Add missing of_node_put()
In tegra_init_apbmisc(), of_find_matching_node() will return a node pointer with refcount incremented. We should use of_node_put() in each failure path or when it is not used anymore. Signed-off-by: Liang He <windhl@126.com> Signed-off-by: Thierry Reding <treding@nvidia.com>
Diffstat (limited to 'drivers/soc/tegra')
-rw-r--r--drivers/soc/tegra/fuse/tegra-apbmisc.c7
1 files changed, 5 insertions, 2 deletions
diff --git a/drivers/soc/tegra/fuse/tegra-apbmisc.c b/drivers/soc/tegra/fuse/tegra-apbmisc.c
index 590c862538d0..eea5de3e5fa5 100644
--- a/drivers/soc/tegra/fuse/tegra-apbmisc.c
+++ b/drivers/soc/tegra/fuse/tegra-apbmisc.c
@@ -182,12 +182,12 @@ void __init tegra_init_apbmisc(void)
*/
if (of_address_to_resource(np, 0, &apbmisc) < 0) {
pr_err("failed to get APBMISC registers\n");
- return;
+ goto put;
}
if (of_address_to_resource(np, 1, &straps) < 0) {
pr_err("failed to get strapping options registers\n");
- return;
+ goto put;
}
}
@@ -208,4 +208,7 @@ void __init tegra_init_apbmisc(void)
}
long_ram_code = of_property_read_bool(np, "nvidia,long-ram-code");
+
+put:
+ of_node_put(np);
}