clk: ti: dra7-atl-clock: Fix possible ERR_PTR dereference
authorKrzysztof Kozlowski <k.kozlowski@samsung.com>
Wed, 13 May 2015 06:54:40 +0000 (15:54 +0900)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Mon, 3 Aug 2015 16:29:17 +0000 (09:29 -0700)
commit9baf2fc882dfe349c227f4d82dd475973dfc8ccd
tree84baff3b8152dce9e46ef6748b6985f39fa64bb1
parentc4087d1c9897eade8ea4122956d4357f5d6a2043
clk: ti: dra7-atl-clock: Fix possible ERR_PTR dereference

commit e0cdcda508f110b7ec190dc7c5eb2869ba73a535 upstream.

of_clk_get_from_provider() returns ERR_PTR on failure. The
dra7-atl-clock driver was not checking its return value and
immediately used it in __clk_get_hw().  __clk_get_hw()
dereferences supplied clock, if it is not NULL, so in that case
it would dereference an ERR_PTR.

Fixes: 9ac33b0ce81f ("CLK: TI: Driver for DRA7 ATL (Audio Tracking Logic)")
Signed-off-by: Krzysztof Kozlowski <k.kozlowski@samsung.com>
Signed-off-by: Stephen Boyd <sboyd@codeaurora.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/clk/ti/clk-dra7-atl.c