From: Claudiu Beznea Date: Mon, 7 Sep 2020 14:46:32 +0000 (+0300) Subject: clk: check hw and hw->dev before dereference it X-Git-Url: http://git.dujemihanovic.xyz/?a=commitdiff_plain;h=b04da9fcf78e233e70ea5ace757c0b8b95bb2459;p=u-boot.git 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 --- 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; }