mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-03-30 11:04:25 +00:00
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>
This commit is contained in:
parent
0c744ea4f7
commit
b92f4380a1
1 changed files with 1 additions and 4 deletions
|
@ -1115,11 +1115,10 @@ static int tegra_emc_probe(struct platform_device *pdev)
|
||||||
}
|
}
|
||||||
|
|
||||||
mc = of_find_device_by_node(np);
|
mc = of_find_device_by_node(np);
|
||||||
|
of_node_put(np);
|
||||||
if (!mc)
|
if (!mc)
|
||||||
return -ENOENT;
|
return -ENOENT;
|
||||||
|
|
||||||
of_node_put(np);
|
|
||||||
|
|
||||||
emc->mc = platform_get_drvdata(mc);
|
emc->mc = platform_get_drvdata(mc);
|
||||||
if (!emc->mc)
|
if (!emc->mc)
|
||||||
return -EPROBE_DEFER;
|
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);
|
err = tegra_emc_load_timings_from_dt(emc, np);
|
||||||
|
|
||||||
of_node_put(np);
|
of_node_put(np);
|
||||||
|
|
||||||
if (err)
|
if (err)
|
||||||
return err;
|
return err;
|
||||||
|
|
||||||
|
|
Loading…
Add table
Reference in a new issue