]> git.kernelconcepts.de Git - karo-tx-linux.git/commit
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)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 19 Jul 2012 15:58:59 +0000 (08:58 -0700)
commit871d4f5e1d82cf0ad56ae076c8535004e7837416
tree0f4fb7a7b182ecbaddec1b81df7f3451072ced51
parentc5e42b8d692877676fc3ba9fdf3dbcbd723b4c2b
clk: Check parent for NULL in clk_change_rate

commit bf47b4fd8f9f81cd5ce40e1945c6334d088226d1 upstream.

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>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/clk/clk.c