mirror of
https://github.com/torvalds/linux.git
synced 2026-11-07 06:17:02 +01:00
soc/tegra: flowctrl: Release OF node reference on error
tegra_flowctrl_init() obtains a reference from
of_find_matching_node() and currently releases it only after
of_address_to_resource() succeeds.
Release the reference before checking the resource conversion result so
the error path is balanced as well.
Fixes: 1fd09e5d88 ("soc/tegra: Add initial flowctrl support for Tegra132/210")
Signed-off-by: Yuho Choi <dbgh9129@gmail.com>
Signed-off-by: Thierry Reding <treding@nvidia.com>
This commit is contained in:
parent
c842922f5f
commit
4eaed7ea6a
|
|
@ -195,11 +195,14 @@ static int __init tegra_flowctrl_init(void)
|
|||
|
||||
np = of_find_matching_node(NULL, tegra_flowctrl_match);
|
||||
if (np) {
|
||||
if (of_address_to_resource(np, 0, &res) < 0) {
|
||||
int err = of_address_to_resource(np, 0, &res);
|
||||
|
||||
of_node_put(np);
|
||||
|
||||
if (err < 0) {
|
||||
pr_err("failed to get flowctrl register\n");
|
||||
return -ENXIO;
|
||||
}
|
||||
of_node_put(np);
|
||||
} else if (IS_ENABLED(CONFIG_ARM)) {
|
||||
/*
|
||||
* Hardcoded fallback for 32-bit Tegra
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user