From: Thierry Reding Date: Thu, 9 Jul 2015 07:59:55 +0000 (+0200) Subject: soc/tegra: pmc: Avoid usage of uninitialized variable X-Git-Url: https://git.stricted.de/?a=commitdiff_plain;h=95169cd23bfa88003f8be06234dbd65f5737add0;p=GitHub%2Fmoto-9609%2Fandroid_kernel_motorola_exynos9610.git soc/tegra: pmc: Avoid usage of uninitialized variable Make sure to only drop the reference to the OF node after it's been successfully obtained. Fixes: 3568df3d31d6 ("soc: tegra: Add thermal reset (thermtrip) support to PMC") Cc: # v4.0+ Reviewed-by: Mikko Perttunen Signed-off-by: Thierry Reding --- diff --git a/drivers/soc/tegra/pmc.c b/drivers/soc/tegra/pmc.c index 75d0457a77b7..fa7036c4daf9 100644 --- a/drivers/soc/tegra/pmc.c +++ b/drivers/soc/tegra/pmc.c @@ -736,12 +736,12 @@ void tegra_pmc_init_tsense_reset(struct tegra_pmc *pmc) u32 value, checksum; if (!pmc->soc->has_tsense_reset) - goto out; + return; np = of_find_node_by_name(pmc->dev->of_node, "i2c-thermtrip"); if (!np) { dev_warn(dev, "i2c-thermtrip node not found, %s.\n", disabled); - goto out; + return; } if (of_property_read_u32(np, "nvidia,i2c-controller-id", &ctrl_id)) {