[PATCH 01/14] avr32/mach-at32ap/clock: check return code of clk_get

From: Kulikov Vasiliy
Date: Sun Sep 05 2010 - 14:32:27 EST


From: Vasiliy Kulikov <segooon@xxxxxxxxx>

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

Signed-off-by: Vasiliy Kulikov <segooon@xxxxxxxxx>
---
arch/avr32/mach-at32ap/clock.c | 6 ++++++
1 files changed, 6 insertions(+), 0 deletions(-)

diff --git a/arch/avr32/mach-at32ap/clock.c b/arch/avr32/mach-at32ap/clock.c
index 442f08c..133a475 100644
--- a/arch/avr32/mach-at32ap/clock.c
+++ b/arch/avr32/mach-at32ap/clock.c
@@ -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);

--
1.7.0.4

--
To unsubscribe from this list: send the line "unsubscribe linux-kernel" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at http://vger.kernel.org/majordomo-info.html
Please read the FAQ at http://www.tux.org/lkml/