mirror of
https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git
synced 2024-09-30 06:10:56 +00:00
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>
This commit is contained in:
parent
e941712ccc
commit
0a3c2dbec4
1 changed files with 5 additions and 2 deletions
|
@ -182,12 +182,12 @@ void __init tegra_init_apbmisc(void)
|
||||||
*/
|
*/
|
||||||
if (of_address_to_resource(np, 0, &apbmisc) < 0) {
|
if (of_address_to_resource(np, 0, &apbmisc) < 0) {
|
||||||
pr_err("failed to get APBMISC registers\n");
|
pr_err("failed to get APBMISC registers\n");
|
||||||
return;
|
goto put;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (of_address_to_resource(np, 1, &straps) < 0) {
|
if (of_address_to_resource(np, 1, &straps) < 0) {
|
||||||
pr_err("failed to get strapping options registers\n");
|
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");
|
long_ram_code = of_property_read_bool(np, "nvidia,long-ram-code");
|
||||||
|
|
||||||
|
put:
|
||||||
|
of_node_put(np);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue