summaryrefslogtreecommitdiff
path: root/drivers/memory
diff options
context:
space:
mode:
authorNathan Chancellor <natechancellor@gmail.com>2020-11-19 12:52:44 -0700
committerKrzysztof Kozlowski <krzk@kernel.org>2020-11-26 18:50:37 +0100
commit0e1bcf2c05d0a681c04351fbd60812aea99354b6 (patch)
treef21dd660decc3b776235fe95636ca81efe83f1d7 /drivers/memory
parent4a91b11c0a100532c466e07a1372d134ab0e753d (diff)
memory: tegra30-emc: Remove unnecessary of_node_put in tegra_emc_probe
Clang warns: drivers/memory/tegra/tegra30-emc.c:1275:15: warning: variable 'np' is uninitialized when used here [-Wuninitialized] of_node_put(np); ^~ drivers/memory/tegra/tegra30-emc.c:1269:24: note: initialize the variable 'np' to silence this warning There does not need to be an of_node_put call in this error handling block after the shuffling of the np assignment. Remove it so there is no use of uninitialized memory. Fixes: 5e00fd90183a ("memory: tegra30-emc: Continue probing if timings are missing in device-tree") Signed-off-by: Nathan Chancellor <natechancellor@gmail.com> Reviewed-by: Dmitry Osipenko <digetx@gmail.com> Link: https://lore.kernel.org/r/20201119195244.1517236-1-natechancellor@gmail.com Signed-off-by: Krzysztof Kozlowski <krzk@kernel.org>
Diffstat (limited to 'drivers/memory')
-rw-r--r--drivers/memory/tegra/tegra30-emc.c4
1 files changed, 1 insertions, 3 deletions
diff --git a/drivers/memory/tegra/tegra30-emc.c b/drivers/memory/tegra/tegra30-emc.c
index 3488786da03b..93f9002d32ad 100644
--- a/drivers/memory/tegra/tegra30-emc.c
+++ b/drivers/memory/tegra/tegra30-emc.c
@@ -1271,10 +1271,8 @@ static int tegra_emc_probe(struct platform_device *pdev)
int err;
emc = devm_kzalloc(&pdev->dev, sizeof(*emc), GFP_KERNEL);
- if (!emc) {
- of_node_put(np);
+ if (!emc)
return -ENOMEM;
- }
emc->mc = devm_tegra_memory_controller_get(&pdev->dev);
if (IS_ERR(emc->mc))