soc/tegra: pmc: Avoid usage of uninitialized variable
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.
Signed-off-by Thierry Reding <[email protected]>
--- drivers/soc/tegra/pmc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/soc/tegra/pmc.c +2 -2
@@ -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
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.
Signed-off-by Thierry Reding <[email protected]>--- drivers/soc/tegra/pmc.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)drivers/soc/tegra/pmc.c +2
-2@@ -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)) {