commit | d3e49d04cad79ccc3d5e1f6203b812e09a38a5cc | [log] [tgz] |
---|---|---|
author | Claudiu Beznea <claudiu.beznea@microchip.com> | Mon Sep 07 17:46:32 2020 +0300 |
committer | Eugen Hristev <eugen.hristev@microchip.com> | Tue Sep 22 11:27:18 2020 +0300 |
tree | 75037cc785cc53d8ac658065d2c5b0462413f0f2 | |
parent | 3b99c03cef8b4d2ceb1d09837ed4a115473a8e66 [diff] [blame] |
clk: check hw and hw->dev before dereference it Check hw and hw->dev before dereference it. Signed-off-by: Claudiu Beznea <claudiu.beznea@microchip.com> Reviewed-by: Simon Glass <sjg@chromium.org>
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index 786f4e8..319808d 100644 --- a/drivers/clk/clk.c +++ b/drivers/clk/clk.c
@@ -57,6 +57,9 @@ const char *clk_hw_get_name(const struct clk *hw) { + assert(hw); + assert(hw->dev); + return hw->dev->name; }