lkml.org 
[lkml]   [2020]   [Nov]   [6]   [last100]   RSS Feed
Views: [wrap][no wrap]   [headers]  [forward] 
 
Messages in this thread
/
SubjectRe: [PATCH] arm: Add clk_get_rate input parameter null check
From
Date
Hello Wang!

On Fri, 2020-11-06 at 09:46 +0800, Wang Qing wrote:
> The input parameter of clk_get_rate() is checked with IS_ERR(),
> so here we need to check null on clk.

Thank you for the patch!

> Signed-off-by: Wang Qing <wangqing@vivo.com>
Acked-by: Alexander Sverdlin <alexander.sverdlin@gmail.com>

> ---
> arch/arm/mach-ep93xx/clock.c | 3 +++
> 1 file changed, 3 insertions(+)
>
> diff --git a/arch/arm/mach-ep93xx/clock.c b/arch/arm/mach-
> ep93xx/clock.c
> index 2810eb5..4313b2f
> --- a/arch/arm/mach-ep93xx/clock.c
> +++ b/arch/arm/mach-ep93xx/clock.c
> @@ -321,6 +321,9 @@ static unsigned long get_uart_rate(struct clk
> *clk)
>
> unsigned long clk_get_rate(struct clk *clk)
> {
> + if (!clk)
> + return 0;
> +
> if (clk->get_rate)
> return clk->get_rate(clk);
>
--
Alexander Sverdlin.


\
 
 \ /
  Last update: 2020-11-06 06:58    [W:0.031 / U:1.428 seconds]
©2003-2020 Jasper Spaans|hosted at Digital Ocean and TransIP|Read the blog|Advertise on this site