mail archive of the barebox mailing list
 help / color / mirror / Atom feed
* [PATCH] clk: fix NULL deref without OF node in debug message
@ 2018-11-20  9:40 matthias.schiffer
  2018-11-20  9:40 ` [PATCH] environment: do not attempt to erase devices with MTD_NO_ERASE matthias.schiffer
                   ` (2 more replies)
  0 siblings, 3 replies; 11+ messages in thread
From: matthias.schiffer @ 2018-11-20  9:40 UTC (permalink / raw)
  To: barebox; +Cc: Matthias Schiffer

From: Matthias Schiffer <matthias.schiffer@ew.tq-group.com>

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@ew.tq-group.com>
---
 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@lists.infradead.org
http://lists.infradead.org/mailman/listinfo/barebox

^ permalink raw reply	[flat|nested] 11+ messages in thread

end of thread, other threads:[~2018-11-26  7:46 UTC | newest]

Thread overview: 11+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2018-11-20  9:40 [PATCH] clk: fix NULL deref without OF node in debug message matthias.schiffer
2018-11-20  9:40 ` [PATCH] environment: do not attempt to erase devices with MTD_NO_ERASE matthias.schiffer
2018-11-21  7:56   ` Sascha Hauer
2018-11-22 10:19     ` Matthias Schiffer
2018-11-23  8:05       ` Sascha Hauer
2018-11-23 14:50         ` [PATCH v2] mtd: return EOPNOTSUPP when attempting to erase an MTD_NO_ERASE device Matthias Schiffer
2018-11-26  7:46           ` Sascha Hauer
2018-11-20  9:40 ` [PATCH] FIT: look for hash-1 as well as hash@1 nodes in signature check matthias.schiffer
2018-11-21  8:01   ` Sascha Hauer
2018-11-22 10:41     ` [PATCH v2] FIT: support hash-1/signature-1 " Matthias Schiffer
2018-11-23  8:07 ` [PATCH] clk: fix NULL deref without OF node in debug message Sascha Hauer

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox