Skip to contentSkip to conversation

soc: rockchip: power-domain: don't try to print the clock name in error case

PATCH New Heiko Stübner 2 participants 3 messages Oct 15, 2015 – Oct 16, 2015 Arm Rockchip

lore
Share & tools
lore

Heiko Stübner

author maintainer
#0 lore raw

PATCH 1/1 soc: rockchip: power-domain: don't try to print the clock name in error case

When we never got the the clock-reference, i.e. when IS_ERR(clk) is true, don't try to print the clock name via %pC as this of course produces a null-pointer-dereference in __clk_get_name().

---
 drivers/soc/rockchip/pm_domains.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
drivers/soc/rockchip/pm_domains.c +2 -2
index 8268d5d..534c589 100644
@@ -265,8 +265,8 @@ static int rockchip_pm_add_one_domain(struct rockchip_pmu *pmu,
 		if (IS_ERR(clk)) {
 			error = PTR_ERR(clk);
 			dev_err(pmu->dev,
-				"%s: failed to get clk %pC (index %d): %d\n",
-				node->name, clk, i, error);
+				"%s: failed to get clk at index %d: %d\n",
+				node->name, i, error);
 			goto err_out;
 		}
 
Signature · 1 line
2.6.1
#1 lore raw

PATCH 1/1 soc: rockchip: power-domain: don't try to print the clock name in error case

Heiko,

Thanks to fix it.

? 2015?10?15? 21:22, Heiko St?bner ??:

Quoted 5 lines

When we never got the the clock-reference, i.e. when IS_ERR(clk) is true, don't try to print the clock name via %pC as this of course produces a null-pointer-dereference in __clk_get_name().

Look good to me, you can free add that.

Quoted 23 lines
---
  drivers/soc/rockchip/pm_domains.c | 4 ++--
  1 file changed, 2 insertions(+), 2 deletions(-)
drivers/soc/rockchip/pm_domains.c +2 -2
index 8268d5d..534c589 100644
@@ -265,8 +265,8 @@ static int rockchip_pm_add_one_domain(struct rockchip_pmu *pmu,
  		if (IS_ERR(clk)) {
  			error = PTR_ERR(clk);
  			dev_err(pmu->dev,
-				"%s: failed to get clk %pC (index %d): %d\n",
-				node->name, clk, i, error);
+				"%s: failed to get clk at index %d: %d\n",
+				node->name, i, error);
  			goto err_out;
  		}
 
Signature · 3 lines
-- 
Thanks,
Caesar
author maintainer Applied
#2 lore raw

PATCH 1/1 soc: rockchip: power-domain: don't try to print the clock name in error case

In reply to Heiko Stübner

Am Donnerstag, 15. Oktober 2015, 15:22:30 schrieb Heiko St?bner:

Quoted 5 lines

When we never got the the clock-reference, i.e. when IS_ERR(clk) is true, don't try to print the clock name via %pC as this of course produces a null-pointer-dereference in __clk_get_name().

applied to my drivers branch with Caesar's Reviewed-tag.