summaryrefslogtreecommitdiffstats
path: root/drivers/clk
diff options
context:
space:
mode:
authorClaudiu Beznea <claudiu.beznea@microchip.com>2020-09-07 17:46:32 +0300
committerEugen Hristev <eugen.hristev@microchip.com>2020-09-22 11:27:18 +0300
commitb04da9fcf78e233e70ea5ace757c0b8b95bb2459 (patch)
tree75037cc785cc53d8ac658065d2c5b0462413f0f2 /drivers/clk
parentba2a0cbb053951ed6d36161989d38da724696b4d (diff)
downloadu-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.c3
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;
}