From b04da9fcf78e233e70ea5ace757c0b8b95bb2459 Mon Sep 17 00:00:00 2001 From: Claudiu Beznea Date: Mon, 7 Sep 2020 17:46:32 +0300 Subject: [PATCH] clk: check hw and hw->dev before dereference it Check hw and hw->dev before dereference it. Signed-off-by: Claudiu Beznea Reviewed-by: Simon Glass --- drivers/clk/clk.c | 3 +++ 1 file changed, 3 insertions(+) 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; } -- 2.39.5