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-Tag: v2025.01-rc5-pxa1908~2192^2^2~31 X-Git-Url: http://git.dujemihanovic.xyz/%7B%7B%20%24style.Permalink%20%7D%7D?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; }