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

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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 kernel-janitors" in
the body of a message to majordomo@xxxxxxxxxxxxxxx
More majordomo info at  http://vger.kernel.org/majordomo-info.html


[Index of Archives]     [Kernel Development]     [Kernel Announce]     [Kernel Newbies]     [Linux Networking Development]     [Share Photos]     [IDE]     [Security]     [Git]     [Netfilter]     [Yosemite News]     [MIPS Linux]     [ARM Linux]     [Device Mapper]

  Powered by Linux