Skip to contentSkip to conversation

soc/tegra: pmc: Avoid usage of uninitialized variable

PATCH In review Thierry Reding 2 participants 2 messages Jul 9, 2015 1 message not in the archive Tegra architecture support

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 soc/tegra: pmc: Avoid usage of uninitialized variable

From: Thierry Reding <[email protected]>

Make sure to only drop the reference to the OF node after it's been successfully obtained.

---
 drivers/soc/tegra/pmc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/soc/tegra/pmc.c +2 -2
index 1878d4da715d..6b0df8154fa4 100644
@@ -1043,12 +1043,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)) {
Signature · 1 line
2.4.1
#2 lore raw
In reply to a message not in the archive

Thanks for the fix; sorry for the typo or whatever you can call it :)

This should also go into 4.0 and 4.1.

Cheers,
Mikko.

Quoted 30 lines · Thierry Reding

From: Thierry Reding <[email protected]>

Make sure to only drop the reference to the OF node after it's been successfully obtained.

---
 drivers/soc/tegra/pmc.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/soc/tegra/pmc.c +2 -2
index 1878d4da715d..6b0df8154fa4 100644
@@ -1043,12 +1043,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)) {