]> git.dujemihanovic.xyz Git - u-boot.git/commitdiff
clk: check hw and hw->dev before dereference it
authorClaudiu Beznea <claudiu.beznea@microchip.com>
Mon, 7 Sep 2020 14:46:32 +0000 (17:46 +0300)
committerEugen Hristev <eugen.hristev@microchip.com>
Tue, 22 Sep 2020 08:27:18 +0000 (11:27 +0300)
Check hw and hw->dev before dereference it.

Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com>
Reviewed-by: Simon Glass <sjg@chromium.org>
drivers/clk/clk.c

index 786f4e887e7aa405f18ed6016f80642820f99d6f..319808d433f5d21c004731d209667e07f0f23d73 100644 (file)
@@ -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;
 }