|
@@ -970,8 +970,10 @@ static int tegra_emc_load_timings_from_dt(struct tegra_emc *emc,
|
|
|
timing = &emc->timings[i++];
|
|
|
|
|
|
err = load_one_timing_from_dt(emc, timing, child);
|
|
|
- if (err)
|
|
|
+ if (err) {
|
|
|
+ of_node_put(child);
|
|
|
return err;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
sort(emc->timings, emc->num_timings, sizeof(*timing), cmp_timings,
|
|
@@ -995,10 +997,8 @@ tegra_emc_find_node_by_ram_code(struct device_node *node, u32 ram_code)
|
|
|
u32 value;
|
|
|
|
|
|
err = of_property_read_u32(np, "nvidia,ram-code", &value);
|
|
|
- if (err || (value != ram_code)) {
|
|
|
- of_node_put(np);
|
|
|
+ if (err || (value != ram_code))
|
|
|
continue;
|
|
|
- }
|
|
|
|
|
|
return np;
|
|
|
}
|