Commit 6ab9810c authored by Shubhrajyoti Datta's avatar Shubhrajyoti Datta Committed by Stephen Boyd

clk: zynqmp: Add a check for NULL pointer

Add a NULL pointer check as clk_hw_get_parent can return NULL.
Signed-off-by: default avatarShubhrajyoti Datta <shubhrajyoti.datta@xilinx.com>
Link: https://lore.kernel.org/r/20220518055314.2486-1-shubhrajyoti.datta@xilinx.comAcked-by: default avatarMichal Simek <michal.simek@amd.com>
Signed-off-by: default avatarStephen Boyd <sboyd@kernel.org>
parent acc1c732
......@@ -120,10 +120,13 @@ static void zynqmp_get_divider2_val(struct clk_hw *hw,
long error = LONG_MAX;
unsigned long div1_prate;
struct clk_hw *div1_parent_hw;
struct zynqmp_clk_divider *pdivider;
struct clk_hw *div2_parent_hw = clk_hw_get_parent(hw);
struct zynqmp_clk_divider *pdivider =
to_zynqmp_clk_divider(div2_parent_hw);
if (!div2_parent_hw)
return;
pdivider = to_zynqmp_clk_divider(div2_parent_hw);
if (!pdivider)
return;
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment