clk: Check parent for NULL in clk_change_rate
authorPawel Moll <pawel.moll@arm.com>
Fri, 8 Jun 2012 13:04:06 +0000 (14:04 +0100)
committerMike Turquette <mturquette@linaro.org>
Mon, 25 Jun 2012 23:51:48 +0000 (16:51 -0700)
clk_change_rate() is accessing parent's rate without checking
if the parent exists at all. In case of root clocks this will
cause NULL pointer dereference.

This patch follows what clk_calc_new_rates() does in such
situation.

Signed-off-by: Pawel Moll <pawel.moll@arm.com>
Signed-off-by: Mike Turquette <mturquette@linaro.org>
Cc: stable@kernel.org
drivers/clk/clk.c

Simple merge