[<prev] [next>] [<thread-prev] [day] [month] [year] [list]
Message-ID: <0fa3332abcf4593376795f52ea145722.sboyd@kernel.org>
Date: Fri, 08 Mar 2024 17:15:37 -0800
From: Stephen Boyd <sboyd@...nel.org>
To: Duoming Zhou <duoming@....edu.cn>, linux-kernel@...r.kernel.org
Cc: linux-arm-kernel@...ts.infradead.org, linux-clk@...r.kernel.org, mturquette@...libre.com, michal.simek@....com, Duoming Zhou <duoming@....edu.cn>
Subject: Re: [PATCH v4] clk: zynq: Prevent null pointer dereference caused by kmalloc failure
Quoting Duoming Zhou (2024-03-01 00:44:37)
> The kmalloc() in zynq_clk_setup() will return null if the
> physical memory has run out. As a result, if we use snprintf()
> to write data to the null address, the null pointer dereference
> bug will happen.
>
> This patch uses a stack variable to replace the kmalloc().
>
> Fixes: 0ee52b157b8e ("clk: zynq: Add clock controller driver")
> Suggested-by: Michal Simek <michal.simek@....com>
> Suggested-by: Stephen Boyd <sboyd@...nel.org>
> Signed-off-by: Duoming Zhou <duoming@....edu.cn>
> ---
Applied to clk-next
Powered by blists - more mailing lists