diff options
author | Olof Johansson <olof@lixom.net> | 2016-07-06 22:33:47 -0700 |
---|---|---|
committer | Olof Johansson <olof@lixom.net> | 2016-07-06 22:33:47 -0700 |
commit | e1d1dfc2c2c25ce5ab2db3f3685c71532200fa01 (patch) | |
tree | 3a643677d73471f396aa7da8ff6531f18e006eba /drivers/memory | |
parent | 34df3b8bdc54709f78b0d72648fee6e53ffd8598 (diff) | |
parent | 55bb1d8355ce91662dc8760f24f578db5a595819 (diff) |
Merge tag 'tegra-for-4.8-memory' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux into next/drivers
memory: tegra: Changes for v4.8-rc1
Contains three reference count fixes from coccinelle.
* tag 'tegra-for-4.8-memory' of git://git.kernel.org/pub/scm/linux/kernel/git/tegra/linux:
memory: tegra: mc: Add missing of_node_put()
memory: tegra: Delete unneeded of_node_put()
memory: tegra: tegra124-emc: Add missing of_node_put()
Signed-off-by: Olof Johansson <olof@lixom.net>
Diffstat (limited to 'drivers/memory')
-rw-r--r-- | drivers/memory/tegra/mc.c | 10 | ||||
-rw-r--r-- | drivers/memory/tegra/tegra124-emc.c | 8 |
2 files changed, 9 insertions, 9 deletions
diff --git a/drivers/memory/tegra/mc.c b/drivers/memory/tegra/mc.c index a1ae0cc2b86d..a4803ac192bb 100644 --- a/drivers/memory/tegra/mc.c +++ b/drivers/memory/tegra/mc.c @@ -186,8 +186,10 @@ static int load_timings(struct tegra_mc *mc, struct device_node *node) timing = &mc->timings[i++]; err = load_one_timing(mc, timing, child); - if (err) + if (err) { + of_node_put(child); return err; + } } return 0; @@ -206,15 +208,13 @@ static int tegra_mc_setup_timings(struct tegra_mc *mc) for_each_child_of_node(mc->dev->of_node, node) { err = of_property_read_u32(node, "nvidia,ram-code", &node_ram_code); - if (err || (node_ram_code != ram_code)) { - of_node_put(node); + if (err || (node_ram_code != ram_code)) continue; - } err = load_timings(mc, node); + of_node_put(node); if (err) return err; - of_node_put(node); break; } diff --git a/drivers/memory/tegra/tegra124-emc.c b/drivers/memory/tegra/tegra124-emc.c index 3dac7be39654..06cc781ebac1 100644 --- a/drivers/memory/tegra/tegra124-emc.c +++ b/drivers/memory/tegra/tegra124-emc.c @@ -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; } |