mirror of
https://github.com/BobTheBlinker/android_kernel_motorola_sm6375.git
synced 2026-10-09 21:59:12 -04:00
clk: qcom: clk-debug: Fix possible NULL dereference in _mux_get_parent
Fix possible NULL dereference in retrieving clk parent name. Change-Id: Ic4dbc6632f00365ea127042c0f3bd9b66a243ec6 Signed-off-by: Vivek Aknurwar <viveka@codeaurora.org>
This commit is contained in:
parent
2c30b06474
commit
bc47796178
1 changed files with 5 additions and 1 deletions
|
|
@ -146,13 +146,17 @@ static u8 clk_debug_mux_get_parent(struct clk_hw *hw)
|
|||
{
|
||||
int i, num_parents = clk_hw_get_num_parents(hw);
|
||||
struct clk_hw *hw_clk = clk_hw_get_parent(hw);
|
||||
struct clk_hw *clk_parent;
|
||||
const char *parent;
|
||||
|
||||
if (!hw_clk)
|
||||
return 0;
|
||||
|
||||
for (i = 0; i < num_parents; i++) {
|
||||
parent = clk_hw_get_name(clk_hw_get_parent_by_index(hw, i));
|
||||
clk_parent = clk_hw_get_parent_by_index(hw, i);
|
||||
if (!clk_parent)
|
||||
return 0;
|
||||
parent = clk_hw_get_name(clk_parent);
|
||||
if (!strcmp(parent, clk_hw_get_name(hw_clk))) {
|
||||
pr_debug("%s: clock parent - %s, index %d\n", __func__,
|
||||
parent, i);
|
||||
|
|
|
|||
Loading…
Reference in a new issue