Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit b92f4380 authored by Christophe Jaillet's avatar Christophe Jaillet Committed by Thierry Reding
Browse files

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: default avatarChristophe JAILLET <christophe.jaillet@wanadoo.fr>
Signed-off-by: default avatarThierry Reding <treding@nvidia.com>
parent 0c744ea4
Loading
Loading
Loading
Loading
+1 −4
Original line number Diff line number Diff line
@@ -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;