Skip to contentSkip to conversation

clk: add support for clock reparent on set_rate

DISCUSSION James Hogan 1 participant 1 message Aug 29, 2013 1 message not in the archive

lore
Share & tools
lore

A message that is not in the archive (sent off-list or not yet received): [email protected]

#1 lore raw
Quoted 20 lines · Dan Carpenter

Hello James Hogan,

This is a semi-automatic email about new static checker warnings.

The patch 71472c0c06cf: "clk: add support for clock reparent on set_rate" from Jul 29, 2013, leads to the following Smatch complaint:

drivers/clk/clk.c:1117 clk_reparent()
warn: variable dereferenced before check 'new_parent' (see line 1113)

drivers/clk/clk.c
1112 if (new_parent->new_child == clk)

                    ^^^^^^^^^^^^^^^^^^^^^

Patch addes dereference.

1113 new_parent->new_child = NULL;
1114
1115 hlist_del(&clk->child_node);
1116
1117 if (new_parent)

Quoted 5 lines
                    ^^^^^^^^^^

Existing check.

  1118			hlist_add_head(&clk->child_node, &new_parent->children);
  1119		else

Thanks for reporting this Dan - much appreciated. I've submitted a fix.

Cheers
James