diff options
author | Christophe Jaillet <christophe.jaillet@wanadoo.fr> | 2017-01-04 08:13:24 +0100 |
---|---|---|
committer | Thierry Reding <treding@nvidia.com> | 2017-01-25 07:57:13 +0100 |
commit | b92f4380a1c7eb3ed19d6f68ad7b66c66d8102b4 (patch) | |
tree | 654fcf2ef2c9cfa6799e197f445f4b518dd534d1 /drivers/memory | |
parent | 0c744ea4f77d72b3dcebb7a8f2684633ec79be88 (diff) |
memory: tegra: Add a missing 'of_node_put()' call
If 'of_find_device_by_node()' fails, an 'of_node_put()' call is missing in
the error handling path.
Fix it by reordering the code.
While at it, remove some empty lines in a more or less similar construction
a few lines below.
Signed-off-by: Christophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: Thierry Reding <treding@nvidia.com>
Diffstat (limited to 'drivers/memory')
-rw-r--r-- | drivers/memory/tegra/tegra124-emc.c | 5 |
1 files changed, 1 insertions, 4 deletions
diff --git a/drivers/memory/tegra/tegra124-emc.c b/drivers/memory/tegra/tegra124-emc.c index 06cc781ebac1..392dc8dd481f 100644 --- a/drivers/memory/tegra/tegra124-emc.c +++ b/drivers/memory/tegra/tegra124-emc.c @@ -1115,11 +1115,10 @@ static int tegra_emc_probe(struct platform_device *pdev) } mc = of_find_device_by_node(np); + of_node_put(np); if (!mc) return -ENOENT; - of_node_put(np); - emc->mc = platform_get_drvdata(mc); if (!emc->mc) return -EPROBE_DEFER; @@ -1135,9 +1134,7 @@ static int tegra_emc_probe(struct platform_device *pdev) } err = tegra_emc_load_timings_from_dt(emc, np); - of_node_put(np); - if (err) return err; |