diff options
author | Claudiu Beznea <claudiu.beznea@microchip.com> | 2020-09-07 17:46:32 +0300 |
---|---|---|
committer | Eugen Hristev <eugen.hristev@microchip.com> | 2020-09-22 11:27:18 +0300 |
commit | b04da9fcf78e233e70ea5ace757c0b8b95bb2459 (patch) | |
tree | 75037cc785cc53d8ac658065d2c5b0462413f0f2 /drivers/clk | |
parent | ba2a0cbb053951ed6d36161989d38da724696b4d (diff) | |
download | u-boot-b04da9fcf78e233e70ea5ace757c0b8b95bb2459.tar.gz u-boot-b04da9fcf78e233e70ea5ace757c0b8b95bb2459.tar.xz u-boot-b04da9fcf78e233e70ea5ace757c0b8b95bb2459.zip |
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>
Diffstat (limited to 'drivers/clk')
-rw-r--r-- | drivers/clk/clk.c | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/drivers/clk/clk.c b/drivers/clk/clk.c index 786f4e887e..319808d433 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; } |