Re: [PATCH] clk: hisilicon: reset: Use kzalloc instead of kmalloc
From: Brian Masney
Date: Wed Feb 25 2026 - 17:40:26 EST
On Tue, Feb 24, 2026 at 10:19:12AM +0800, Shawn Guo wrote:
> With commit c721f189e89c ("reset: Instantiate reset GPIO controller for
> shared reset-gpios") in place, the call sequence hisi_reset_init() ->
> reset_controller_register() starts failing on Hi3798CV200 Poplar platform,
> due to the new check added by the commit above.
>
> if (rcdev->of_node && rcdev->of_args)
> return -EINVAL;
>
> The failure is caused by that hisi_reset_init() allocates memory for rcdev
> without zeroing it out. Fix the issue by using kzalloc instead of
> kmalloc for memory allocation.
>
> Signed-off-by: Shawn Guo <shawnguo@xxxxxxxxxx>
Reviewed-by: Brian Masney <bmasney@xxxxxxxxxx>