From: 黄涛 Date: Mon, 7 May 2012 12:11:36 +0000 (+0800) Subject: rk30: clock: clk_get_parent return error when clk invalid X-Git-Tag: firefly_0821_release~9244 X-Git-Url: http://demsky.eecs.uci.edu/git/?a=commitdiff_plain;h=fd8103d56ad8b98f28b9a665dd4f3eefd9d90be2;p=firefly-linux-kernel-4.4.55.git rk30: clock: clk_get_parent return error when clk invalid --- diff --git a/arch/arm/mach-rk30/clock.c b/arch/arm/mach-rk30/clock.c index 572e59e2f9ed..6950186b5cf3 100755 --- a/arch/arm/mach-rk30/clock.c +++ b/arch/arm/mach-rk30/clock.c @@ -445,6 +445,9 @@ struct clk *rk30_clk_get_parent(struct clk *clk) struct clk *clk_get_parent(struct clk *clk) #endif { + if (clk == NULL || IS_ERR(clk)) { + return ERR_PTR(-EINVAL); + } return clk->parent; }