Skip to contentSkip to conversation

ARM: shmobile: lager: fix error return code check from clk_get()

PATCH In review Ben Dooks 2 participants 3 messages Jan 14, 2014 – Jan 15, 2014

Subsystems (4)
lore
Share & tools
lore

Ben Dooks

author
#0 lore raw

PATCH 1/2 ARM: shmobile: lager: fix error return code check from clk_get()

The lager_add_standard_devices() function calls clk_get() but then fails to check that it returns an error pointer instead of NULL on failure.

This was added by 4a606af2 ("ARM: shmobile: lager-reference: Instantiate clkdevs for SCIF and CMT") patch in horms' renesas-boards2-for-v3.14~6 release.

The issue is not serious as it does not cause a crash and seems to not be actually causing any issues now the other clock bugs have been fixed.

Cc Laurent Pinchart <[email protected]>
Cc Simon Horman <[email protected]>
---
 arch/arm/mach-shmobile/board-lager-reference.c | 4 ++--
 1 file changed, 2 insertions(+), 2 deletions(-)
arch/arm/mach-shmobile/board-lager-reference.c +2 -2
index a6e271d..dc8d76b 100644
@@ -44,14 +44,14 @@ static void __init lager_add_standard_devices(void)
 
 	for (i = 0; i < ARRAY_SIZE(scif_names); ++i) {
 		clk = clk_get(NULL, scif_names[i]);
-		if (clk) {
+		if (!IS_ERR(clk)) {
 			clk_register_clkdev(clk, NULL, "sh-sci.%u", i);
 			clk_put(clk);
 		}
 	}
 
 	clk = clk_get(NULL, "cmt0");
-	if (clk) {
+	if (!IS_ERR(clk)) {
 		clk_register_clkdev(clk, NULL, "sh_cmt.0");
 		clk_put(clk);
 	}
Signature · 1 line
1.8.5.2
Acked-by Laurent Pinchart on v1 1/2
#1 lore raw
Quoted 7 lines · Ben Dooks

The lager_add_standard_devices() function calls clk_get() but then fails to check that it returns an error pointer instead of NULL on failure.

This was added by 4a606af2 ("ARM: shmobile: lager-reference: Instantiate clkdevs for SCIF and CMT") patch in horms' renesas-boards2-for-v3.14~6 release.

Quoted 6 lines

The issue is not serious as it does not cause a crash and seems to not be actually causing any issues now the other clock bugs have been fixed.

Cc Laurent Pinchart <[email protected]>
Cc Simon Horman <[email protected]>

Thanks, I have queued up the following:

From: Ben Dooks <[email protected]>

ARM: shmobile: lager: fix error return code check from clk_get()

The lager_add_standard_devices() function calls clk_get() but then fails to check that it returns an error pointer instead of NULL on failure.

This was added by 4a606af2 ("ARM: shmobile: lager-reference: Instantiate clkdevs for SCIF and CMT") patch in Simon Horman's renesas-boards2-for-v3.14 tag.

The issue is not serious as it does not cause a crash and seems to not be actually causing any issues now the other clock bugs have been fixed.

arch/arm/mach-shmobile/board-lager-reference.c +2 -2
index a6e271d..dc8d76b 100644
@@ -44,14 +44,14 @@ static void __init lager_add_standard_devices(void)
 
 	for (i = 0; i < ARRAY_SIZE(scif_names); ++i) {
 		clk = clk_get(NULL, scif_names[i]);
-		if (clk) {
+		if (!IS_ERR(clk)) {
 			clk_register_clkdev(clk, NULL, "sh-sci.%u", i);
 			clk_put(clk);
 		}
 	}
 
 	clk = clk_get(NULL, "cmt0");
-	if (clk) {
+	if (!IS_ERR(clk)) {
 		clk_register_clkdev(clk, NULL, "sh_cmt.0");
 		clk_put(clk);
 	}
author
#2 lore raw
In reply to Ben Dooks
Quoted 8 lines · Simon Horman
Quoted 7 lines · Ben Dooks

The lager_add_standard_devices() function calls clk_get() but then fails to check that it returns an error pointer instead of NULL on failure.

This was added by 4a606af2 ("ARM: shmobile: lager-reference: Instantiate clkdevs for SCIF and CMT") patch in horms' renesas-boards2-for-v3.14~6 release.

Quoted 8 lines
Quoted 6 lines

The issue is not serious as it does not cause a crash and seems to not be actually causing any issues now the other clock bugs have been fixed.

Cc Laurent Pinchart <[email protected]>
Cc Simon Horman <[email protected]>

Thanks, I have queued up the following:

Great, will try and re-test on a latest devel branch in the next few days.

Signature · 2 lines
Ben Dooks				http://www.codethink.co.uk/
Senior Engineer				Codethink - Providing Genius