From: James Hogan Date: Thu, 29 Aug 2013 11:10:51 +0000 (+0100) Subject: clk: fix new_parent dereference before null check X-Git-Tag: v3.12-rc1~78^2~18 X-Git-Url: http://git.openpandora.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=903efc553f738030a4ffa23fa03e7f329655c1c2;p=pandora-kernel.git clk: fix new_parent dereference before null check Commit 71472c0 (clk: add support for clock reparent on set_rate) added a dereference of the new_parent pointer in clk_reparent(), but as detected by smatch clk_reparent() later checks whether new_parent is NULL. The dereference was in order to clear the new parent's new_child pointer to avoid duplicate POST_RATE_CHANGE notifications, so clearly isn't necessary if the new parent is NULL, so move it inside the "if (new_parent)" block. Reported-by: Dan Carpenter Signed-off-by: James Hogan Signed-off-by: Mike Turquette --- Reading git-diff-tree failed