clk: qcom: clk-aop-qmp: use correct name pointer before clock registration

clk_aop_qmp_prepare() is called from aop_qmp_clk_probe() before
devm_clk_register() is called.  This means that clock hw->core
pointers are NULL and clk_hw_get_name(hw) triggers a NULL pointer
dereference.  Use hw->init->name instead of clk_hw_get_name(hw)
to avoid the NULL pointer dereference.

Change-Id: I548df6518053260d44227adc0479b1ea52a81fc9
Signed-off-by: David Collins <collinsd@codeaurora.org>
This commit is contained in:
David Collins 2018-08-03 16:45:49 -07:00
commit b61011ada5

View file

@ -149,7 +149,8 @@ static int clk_aop_qmp_prepare(struct clk_hw *hw)
ret = mbox_send_message(clk->mbox, &pkt);
if (ret < 0) {
pr_err("Failed to send clk prepare request for %s, ret %d\n",
clk_hw_get_name(hw), ret);
hw->core ? clk_hw_get_name(hw) : hw->init->name,
ret);
goto err;
}