[PATCH] clk: fix NULL deref without OF node in debug message

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

 



From: Matthias Schiffer <matthias.schiffer@xxxxxxxxxxxxxxx>

of_clk_add_provider() may be called for devices added via
add_generic_device(). There is no OF node in this case, leading to a crash
when debug logs are enabled.

This affects various i.MX CPUs, which add imx*-ccm clock devices using
add_generic_device().

Signed-off-by: Matthias Schiffer <matthias.schiffer@xxxxxxxxxxxxxxx>
---
 drivers/clk/clk.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index 24759b45b..6a2d8ad17 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -413,7 +413,7 @@ int of_clk_add_provider(struct device_node *np,
 	cp->get = clk_src_get;
 
 	list_add(&cp->link, &of_clk_providers);
-	pr_debug("Added clock from %s\n", np->full_name);
+	pr_debug("Added clock from %s\n", np ? np->full_name : "<none>");
 
 	return 0;
 }
-- 
2.17.1


_______________________________________________
barebox mailing list
barebox@xxxxxxxxxxxxxxxxxxx
http://lists.infradead.org/mailman/listinfo/barebox



[Index of Archives]     [Linux Embedded]     [Linux USB Devel]     [Linux Audio Users]     [Yosemite News]     [Linux Kernel]     [Linux SCSI]     [XFree86]

  Powered by Linux