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>
This commit is contained in:
Claudiu Beznea 2020-09-07 17:46:32 +03:00 committed by Eugen Hristev
parent ba2a0cbb05
commit b04da9fcf7

View File

@ -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;
}