Skip to contentSkip to conversation

avr32/mach-at32ap/clock: check return code of clk_get

PATCH In review Kulikov Vasiliy 1 participant 1 message Sep 5, 2010 Kernel janitors

lore
Share & tools
lore
#0 lore raw

PATCH 1/14 avr32/mach-at32ap/clock: check return code of clk_get

From: Vasiliy Kulikov <[email protected]>

Function clk_get may return ERR_PTR(...). Check for it.

---
 arch/avr32/mach-at32ap/clock.c |    6 ++++++
 1 files changed, 6 insertions(+), 0 deletions(-)
arch/avr32/mach-at32ap/clock.c +6 -0
index 442f08c..133a475 100644
@@ -258,14 +258,20 @@ static int clk_show(struct seq_file *s, void *unused)
 
 	/* show clock tree as derived from the three oscillators */
 	clk = clk_get(NULL, "osc32k");
+	if (IS_ERR(clk))
+		return PTR_ERR(clk);
 	dump_clock(clk, &r);
 	clk_put(clk);
 
 	clk = clk_get(NULL, "osc0");
+	if (IS_ERR(clk))
+		return PTR_ERR(clk);
 	dump_clock(clk, &r);
 	clk_put(clk);
 
 	clk = clk_get(NULL, "osc1");
+	if (IS_ERR(clk))
+		return PTR_ERR(clk);
 	dump_clock(clk, &r);
 	clk_put(clk);
 
Signature · 1 line
1.7.0.4