[PATCH v3 01/21] clk: check hw and hw->dev before dereference it
Claudiu Beznea
claudiu.beznea at microchip.com
Mon Sep 7 16:46:32 CEST 2020
Check hw and hw->dev before dereference it.
Signed-off-by: Claudiu Beznea <claudiu.beznea at microchip.com>
Reviewed-by: Simon Glass <sjg at chromium.org>
---
drivers/clk/clk.c | 3 +++
1 file changed, 3 insertions(+)
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c
index 786f4e887e7a..319808d433f5 100644
--- a/drivers/clk/clk.c
+++ b/drivers/clk/clk.c
@@ -57,6 +57,9 @@ ulong clk_generic_get_rate(struct clk *clk)
const char *clk_hw_get_name(const struct clk *hw)
{
+ assert(hw);
+ assert(hw->dev);
+
return hw->dev->name;
}
--
2.7.4
More information about the U-Boot
mailing list